Closed
Description
The message is technically correct, but it refers to a generic name U
that is not present in user's source code, and has no meaning in the current context.
fn main() {
assert_eq!("bar".into(), "foo".into());
}
error[E0282]: unable to infer enough type information about
U
cannot infer type forU
It's even weirder that the type U
is not in Into<T>
's definition, but comes from somewhere else inside stdlib.
pub trait Into<T> {
fn into(self) -> T;
}
It would be clearer if rustc has shown Into<U>
instead, or perhaps the stdlib implementation could rename the cryptic U
to something self-explanatory like TypeToBeConvertedInto
.
Metadata
Metadata
Assignees
Labels
No labels