]> git.lizzy.rs Git - rust.git/blob - tests/ui/binop/issue-93927.rs
Don't resolve type var roots in point_at_expr_source_of_inferred_type
[rust.git] / tests / ui / binop / issue-93927.rs
1 // Regression test for #93927: suggested trait bound for T should be Eq, not PartialEq
2 struct MyType<T>(T);
3
4 impl<T> PartialEq for MyType<T>
5 where
6     T: Eq,
7 {
8     fn eq(&self, other: &Self) -> bool {
9         true
10     }
11 }
12
13 fn cond<T: PartialEq>(val: MyType<T>) -> bool {
14     val == val
15     //~^ ERROR binary operation `==` cannot be applied to type `MyType<T>`
16 }
17
18 fn main() {
19     cond(MyType(0));
20 }