]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/invalid-bin-op.stderr
Rollup merge of #99079 - compiler-errors:issue-99073, r=oli-obk
[rust.git] / src / test / ui / suggestions / invalid-bin-op.stderr
1 error[E0369]: binary operation `==` cannot be applied to type `S<T>`
2   --> $DIR/invalid-bin-op.rs:2:15
3    |
4 LL |     let _ = s == t;
5    |             - ^^ - S<T>
6    |             |
7    |             S<T>
8    |
9 note: an implementation of `PartialEq<_>` might be missing for `S<T>`
10   --> $DIR/invalid-bin-op.rs:5:1
11    |
12 LL | struct S<T>(T);
13    | ^^^^^^^^^^^ must implement `PartialEq<_>`
14 help: consider annotating `S<T>` with `#[derive(PartialEq)]`
15    |
16 LL | #[derive(PartialEq)]
17    |
18 help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
19    |
20 LL | pub fn foo<T>(s: S<T>, t: S<T>) where S<T>: PartialEq {
21    |                                 +++++++++++++++++++++
22
23 error: aborting due to previous error
24
25 For more information about this error, try `rustc --explain E0369`.