2020-06-24 18:17:04 -05:00
|
|
|
error[E0369]: binary operation `==` cannot be applied to type `S<T>`
|
|
|
|
--> $DIR/invalid-bin-op.rs:2:15
|
|
|
|
|
|
|
|
|
LL | let _ = s == t;
|
|
|
|
| - ^^ - S<T>
|
|
|
|
| |
|
|
|
|
| S<T>
|
|
|
|
|
|
2023-04-26 19:57:13 -05:00
|
|
|
note: an implementation of `PartialEq` might be missing for `S<T>`
|
2021-09-28 09:48:54 -05:00
|
|
|
--> $DIR/invalid-bin-op.rs:5:1
|
|
|
|
|
|
|
|
|
LL | struct S<T>(T);
|
2023-04-26 19:57:13 -05:00
|
|
|
| ^^^^^^^^^^^ must implement `PartialEq`
|
2021-09-28 09:48:54 -05:00
|
|
|
help: consider annotating `S<T>` with `#[derive(PartialEq)]`
|
|
|
|
|
|
2023-03-17 21:18:39 -05:00
|
|
|
LL + #[derive(PartialEq)]
|
|
|
|
LL | struct S<T>(T);
|
2021-09-28 09:48:54 -05:00
|
|
|
|
|
2022-06-05 19:37:45 -05:00
|
|
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
2022-02-15 16:49:16 -06:00
|
|
|
|
|
|
|
|
LL | pub fn foo<T>(s: S<T>, t: S<T>) where S<T>: PartialEq {
|
|
|
|
| +++++++++++++++++++++
|
2020-06-24 18:17:04 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0369`.
|