rust/src/test/ui/suggestions/missing-trait-bound-for-op.rs
Esteban Küber 8f40dae93b Suggest type param trait bound for binop only when appropriate
Verify that the binop trait *is* implemented for the types *if* all the
involved type parameters are replaced with fresh inferred types. When
this is the case, it means that the type parameter was indeed missing a
trait bound. If this is not the case, provide a generic `note` refering
to the type that doesn't implement the expected trait.
2020-06-24 16:17:04 -07:00

8 lines
151 B
Rust

// run-rustfix
pub fn foo<T>(s: &[T], t: &[T]) {
let _ = s == t; //~ ERROR binary operation `==` cannot be applied to type `&[T]`
}
fn main() {}