The classic example is when people try to use unwrap() on Result and the error side doesn’t implement Debug. It’s in the docs but can be easily be missed.
Happened to me earlier this morning and I also saw this reddit post a few minutes ago.
Right now this is the error message you get
error: type `core::result::Result<T, <T as core::str::FromStr>::Err>` does not implement any method in scope named `unwrap`
If we could have something like this instead it’d be awesome
error: type `core::result::Result<T, <T as core::str::FromStr>::Err>` does not implement any `unwrap` variant in scope. Choices are:
core::result::Result<T, E>.unwrap(self) -> T where E: std::fmt::Debug
// ok this sucks but you get the idea
We already have something similar when you use a trait method but the trait itself isn’t in the scope.
Thank you for reading.