Open
Description
The following code fails to infer the type of x
, as well as the call to the inherent method as_str
:
fn f<T: Into<String>>(u: T) {
let x = u.into();
x.as_str();
}
rustc has no problem with this code, since the .into()
call will eagerly use the T: Into<String>
bound from the where clause. This happens despite plenty of other Into
impls existing in the wild and is an intentional Rust feature.