2020-06-24 23:17:04 +00: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-27 00:57:13 +00:00
|
|
|
note: an implementation of `PartialEq` might be missing for `S<T>`
|
2021-09-28 14:48:54 +00:00
|
|
|
--> $DIR/invalid-bin-op.rs:5:1
|
|
|
|
|
|
|
|
|
LL | struct S<T>(T);
|
2023-04-27 00:57:13 +00:00
|
|
|
| ^^^^^^^^^^^ must implement `PartialEq`
|
2021-09-28 14:48:54 +00:00
|
|
|
help: consider annotating `S<T>` with `#[derive(PartialEq)]`
|
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + #[derive(PartialEq)]
|
|
|
|
LL | struct S<T>(T);
|
2021-09-28 14:48:54 +00:00
|
|
|
|
|
2024-01-27 16:22:47 +00:00
|
|
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
|
|
|
|
|
|
|
|
LL | pub fn foo<T>(s: S<T>, t: S<T>) where S<T>: PartialEq {
|
|
|
|
| +++++++++++++++++++++
|
2020-06-24 23:17:04 +00:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2020-06-24 23:17:04 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0369`.
|