trait Trait {} impl Trait for () {} fn bad_echo(_t: T) -> T { "this should not suggest impl Trait" //~ ERROR mismatched types } fn bad_echo_2(_t: T) -> T { "this will not suggest it, because that would probably be wrong" //~ ERROR mismatched types } fn other_bounds_bad() -> T where T: Send, Option: Send, { "don't suggest this, because Option places additional constraints" //~ ERROR mismatched types } // FIXME: implement this check trait GenericTrait {} fn used_in_trait() -> T where T: Send, (): GenericTrait, { "don't suggest this, because the generic param is used in the bound." //~ ERROR mismatched types } fn main() {}