]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binop/issue-93927.rs
Rollup merge of #96051 - newpavlov:duration_rounding, r=nagisa,joshtriplett
[rust.git] / src / test / 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 }