Closed
Description
fn f<T>(x: T) { x + 4; }
fn g<T>(x: T) { println!("{}", x); }
fn h<T>(x: T) { trait X {} fn hh<T:X>(x: T) {} hh(x); }
Codes like these currently do not point to the original declaration of T
for missing trait bounds. In some cases rustc even does not indicate which trait is unimplemented (f
). Hinting T: Trait
bounds would be helpful for those cases.
#19950 (Provide better error reporting for unimplemented traits) is related and in principle would be a superset, but the issue currently only discusses about nominal types and not generic types.