-
-
Notifications
You must be signed in to change notification settings - Fork 203
Description
I have a use case where this example from the README is exactly what I need:
#[derive(Error, Debug)]
pub enum MyError {
Io {
#[from]
source: io::Error,
backtrace: Backtrace,
},
}However, when I compile it (Rust Playground link) I get the following error:
no `ThiserrorProvide` in `__private`
Compiling playground v0.0.1 (/playground)
error[E0432]: unresolved import `thiserror`
--> src/lib.rs:5:10
|
5 | #[derive(Error, Debug)]
| ^^^^^ no `ThiserrorProvide` in `__private`
|
note: found an item that was configured out
--> /playground/.cargo/registry/src/index.crates.io-6f17d22bba15001f/thiserror-1.0.48/src/lib.rs:256:29
|
256 | pub use crate::provide::ThiserrorProvide;
| ^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0658]: use of unstable library feature 'error_generic_member_access'
--> src/lib.rs:5:10
|
5 | #[derive(Error, Debug)]
| ^^^^^
|
= note: see issue #99301 rust-lang/rust#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[E0277]: MyError doesn't implement std::fmt::Display
--> src/lib.rs:6:10
|
6 | pub enum MyError {
| ^^^^^^^ MyError cannot be formatted with the default formatter
|
= help: the trait std::fmt::Display is not implemented for MyError
= note: in format strings you may be able to use {:?} (or {:#?} for pretty-print) instead
note: required by a bound in std::error::Error
--> /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/error.rs:32:1