You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is anyhow's fault, or the compiler's fault.
When using .context, I get the following error:
error[E0599]: no method named `context` found for type `std::result::Result<(), anyhow::error::Error>` in the current scope
--> src/main.rs:83:13
|
83 | context(format!("failure in {} with nesting", c.name))?;
| ^^^^^^^ method not found in `std::result::Result<(), anyhow::error::Error>`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
19 | use anyhow::context::Context;
That last line is awful advice, as that just leads to:
error[E0603]: module `context` is private
--> src/main.rs:24:13
|
24 | use anyhow::context::Context;
| ^^^^^^^
The real fix is: use anyhow::Context. I don't know how to fix this message, but I feel it would make anyhow more usable if it was fixed.
The text was updated successfully, but these errors were encountered:
Thanks! This is the compiler being dumb. It shouldn't put private paths in suggestions like that. Could you check whether there is an issue already filed for this in rust-lang/rust and file one if you can't find an existing one?
I'm not sure if this is anyhow's fault, or the compiler's fault.
When using .context, I get the following error:
That last line is awful advice, as that just leads to:
The real fix is:
use anyhow::Context
. I don't know how to fix this message, but I feel it would make anyhow more usable if it was fixed.The text was updated successfully, but these errors were encountered: