2024-11-20 04:30:35 +00:00
error: constant of non-structural type `B` in a pattern
--> $DIR/issue-62307-match-ref-ref-forbidden-without-eq.rs:35:9
2019-07-03 16:54:08 +02:00
|
2024-11-20 04:30:35 +00:00
LL | struct B(i32);
| -------- `B` must be annotated with `#[derive(PartialEq)]` to be usable in patterns
...
2024-11-20 02:15:21 +00:00
LL | const RR_B1: & & B = & & B(1);
| ------------------ constant defined here
...
2019-07-03 16:54:08 +02:00
LL | RR_B1 => { println!("CLAIM RR0: {:?} matches {:?}", RR_B1, RR_B0); }
2024-11-20 04:30:35 +00:00
| ^^^^^ constant of non-structural type
|
note: the `PartialEq` trait must be derived, manual `impl`s are not sufficient; see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details
--> $DIR/issue-62307-match-ref-ref-forbidden-without-eq.rs:22:1
2019-07-03 16:54:08 +02:00
|
2024-11-20 04:30:35 +00:00
LL | impl PartialEq for B {
| ^^^^^^^^^^^^^^^^^^^^
2019-07-03 16:54:08 +02:00
2024-11-20 04:30:35 +00:00
error: constant of non-structural type `B` in a pattern
--> $DIR/issue-62307-match-ref-ref-forbidden-without-eq.rs:42:9
2019-07-03 16:54:08 +02:00
|
2024-11-20 04:30:35 +00:00
LL | struct B(i32);
| -------- `B` must be annotated with `#[derive(PartialEq)]` to be usable in patterns
...
2024-11-20 02:15:21 +00:00
LL | const RR_B1: & & B = & & B(1);
| ------------------ constant defined here
...
2019-07-03 16:54:08 +02:00
LL | RR_B1 => { println!("CLAIM RR1: {:?} matches {:?}", RR_B1, RR_B1); }
2024-11-20 04:30:35 +00:00
| ^^^^^ constant of non-structural type
|
note: the `PartialEq` trait must be derived, manual `impl`s are not sufficient; see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details
--> $DIR/issue-62307-match-ref-ref-forbidden-without-eq.rs:22:1
2019-07-03 16:54:08 +02:00
|
2024-11-20 04:30:35 +00:00
LL | impl PartialEq for B {
| ^^^^^^^^^^^^^^^^^^^^
2019-07-03 16:54:08 +02:00
2024-05-03 15:24:53 +02:00
error: aborting due to 2 previous errors
2024-01-27 13:52:06 +01:00