Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

derive(Error) with Backtrace causes errors on beta #204

Closed
Heliozoa opened this issue Oct 28, 2022 · 2 comments
Closed

derive(Error) with Backtrace causes errors on beta #204

Heliozoa opened this issue Oct 28, 2022 · 2 comments

Comments

@Heliozoa
Copy link

Hi,
Thanks for your work on thiserror.

I'm trying to use std::backtrace::Backtrace with thiserror now that std::backtrace is available on beta, but I'm getting a couple of errors.

https://play.rust-lang.org/?version=beta&mode=debug&edition=2021&gist=e66ea95c9e0f2b4bea73d1cb4b503716

Compiling playground v0.0.1 (/playground)
error[[E0432]](https://doc.rust-lang.org/beta/error-index.html#E0432): unresolved import `thiserror`
 --> src/lib.rs:5:10
  |
5 | #[derive(Error, Debug)]
  |          ^^^^^ no `ThiserrorProvide` in `__private`
  |
  = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

error[[E0658]](https://doc.rust-lang.org/beta/error-index.html#E0658): use of unstable library feature 'error_generic_member_access'
 --> src/lib.rs:5:10
  |
5 | #[derive(Error, Debug)]
  |          ^^^^^
  |
  = note: [see issue #99301 <https://github.com/rust-lang/rust/issues/99301>](https://github.com/rust-lang/rust/issues/99301) for more information
  = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

error[[E0599]](https://doc.rust-lang.org/beta/error-index.html#E0599): no method named `thiserror_provide` found for reference `&std::io::Error` in the current scope
  --> src/lib.rs:10:9
   |
10 |         source: io::Error,
   |         ^^^^^^ method not found in `&std::io::Error`

Some errors have detailed explanations: E0432, E0599, E0658.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `playground` due to 3 previous errors

I saw that there are other similar issues posted, but they seem to be related to rust-analyzer, and given that this is reproduceable on the playground I felt fairly confident that this is a new issue.

@dtolnay
Copy link
Owner

dtolnay commented Oct 28, 2022

Rust 1.65 (current beta) only stabilizes the Backtrace type, not any of the functionality for using backtraces with the Error trait. You can't use backtraces in an error until the rest is stabilized as well.

@dtolnay dtolnay closed this as completed Oct 28, 2022
@lvaroqui-gpfw
Copy link

Just my 2 cents, but I was really confused that all backtraces related features didn't work on stable (1.65 as of today). I think there should be a disclaimer in the docs until this hits stable.

Repository owner locked and limited conversation to collaborators Jan 1, 2023
Repository owner deleted a comment from miaomiao1992 Jan 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants