We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Adding context seems to break type inference. For example:
use anyhow::{Context, Result}; fn main() -> Result<()> { let x = "k"; let y: u32 = x.parse().context("context")?; println!("{}", y); Ok(()) }
gives
error[E0284]: type annotations required: cannot resolve `<_ as std::str::FromStr>::Err == _` --> src\main.rs:5:20 | 5 | let y: u32 = x.parse().context("context")?; |
obviously using turbofish syntax works, like:
let y = x.parse::<u32>().context("context")?;
but it is surprising behaviour. Might be a compiler limitation but I still wanted to mention it.
The text was updated successfully, but these errors were encountered:
Thanks! Should be fixed in 1.0.12.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Adding context seems to break type inference. For example:
gives
obviously using turbofish syntax works, like:
but it is surprising behaviour. Might be a compiler limitation but I still wanted to mention it.
The text was updated successfully, but these errors were encountered: