@@ -28,22 +28,32 @@ error: unreachable pattern
2828LL | Foo(_) => {} // should not be emitting unreachable warning
2929 | ^^^^^^
3030
31+ warning: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
32+ --> $DIR/consts-opaque.rs:49:9
33+ |
34+ LL | FOO_REF_REF => {}
35+ | ^^^^^^^^^^^
36+ |
37+ = note: `#[warn(indirect_structural_match)]` on by default
38+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
39+ = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
40+
3141error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
32- --> $DIR/consts-opaque.rs:55 :9
42+ --> $DIR/consts-opaque.rs:57 :9
3343 |
3444LL | BAR => {} // should not be emitting unreachable warning
3545 | ^^^
3646
3747error: unreachable pattern
38- --> $DIR/consts-opaque.rs:55 :9
48+ --> $DIR/consts-opaque.rs:57 :9
3949 |
4050LL | Bar => {}
4151 | --- matches any value
4252LL | BAR => {} // should not be emitting unreachable warning
4353 | ^^^ unreachable pattern
4454
4555error: unreachable pattern
46- --> $DIR/consts-opaque.rs:58 :9
56+ --> $DIR/consts-opaque.rs:60 :9
4757 |
4858LL | Bar => {}
4959 | --- matches any value
@@ -52,19 +62,19 @@ LL | _ => {}
5262 | ^ unreachable pattern
5363
5464error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
55- --> $DIR/consts-opaque.rs:63 :9
65+ --> $DIR/consts-opaque.rs:65 :9
5666 |
5767LL | BAR => {}
5868 | ^^^
5969
6070error: unreachable pattern
61- --> $DIR/consts-opaque.rs:65 :9
71+ --> $DIR/consts-opaque.rs:67 :9
6272 |
6373LL | Bar => {} // should not be emitting unreachable warning
6474 | ^^^
6575
6676error: unreachable pattern
67- --> $DIR/consts-opaque.rs:67 :9
77+ --> $DIR/consts-opaque.rs:69 :9
6878 |
6979LL | Bar => {} // should not be emitting unreachable warning
7080 | --- matches any value
@@ -73,76 +83,76 @@ LL | _ => {}
7383 | ^ unreachable pattern
7484
7585error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
76- --> $DIR/consts-opaque.rs:72 :9
86+ --> $DIR/consts-opaque.rs:74 :9
7787 |
7888LL | BAR => {}
7989 | ^^^
8090
8191error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
82- --> $DIR/consts-opaque.rs:74 :9
92+ --> $DIR/consts-opaque.rs:76 :9
8393 |
8494LL | BAR => {} // should not be emitting unreachable warning
8595 | ^^^
8696
8797error: unreachable pattern
88- --> $DIR/consts-opaque.rs:74 :9
98+ --> $DIR/consts-opaque.rs:76 :9
8999 |
90100LL | BAR => {} // should not be emitting unreachable warning
91101 | ^^^
92102
93103error: unreachable pattern
94- --> $DIR/consts-opaque.rs:77 :9
104+ --> $DIR/consts-opaque.rs:79 :9
95105 |
96106LL | _ => {} // should not be emitting unreachable warning
97107 | ^
98108
99109error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
100- --> $DIR/consts-opaque.rs:82 :9
110+ --> $DIR/consts-opaque.rs:84 :9
101111 |
102112LL | BAZ => {}
103113 | ^^^
104114
105115error: unreachable pattern
106- --> $DIR/consts-opaque.rs:84 :9
116+ --> $DIR/consts-opaque.rs:86 :9
107117 |
108118LL | Baz::Baz1 => {} // should not be emitting unreachable warning
109119 | ^^^^^^^^^
110120
111121error: unreachable pattern
112- --> $DIR/consts-opaque.rs:86 :9
122+ --> $DIR/consts-opaque.rs:88 :9
113123 |
114124LL | _ => {}
115125 | ^
116126
117127error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
118- --> $DIR/consts-opaque.rs:92 :9
128+ --> $DIR/consts-opaque.rs:94 :9
119129 |
120130LL | BAZ => {}
121131 | ^^^
122132
123133error: unreachable pattern
124- --> $DIR/consts-opaque.rs:94 :9
134+ --> $DIR/consts-opaque.rs:96 :9
125135 |
126136LL | _ => {}
127137 | ^
128138
129139error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
130- --> $DIR/consts-opaque.rs:99 :9
140+ --> $DIR/consts-opaque.rs:101 :9
131141 |
132142LL | BAZ => {}
133143 | ^^^
134144
135145error: unreachable pattern
136- --> $DIR/consts-opaque.rs:101 :9
146+ --> $DIR/consts-opaque.rs:103 :9
137147 |
138148LL | Baz::Baz2 => {} // should not be emitting unreachable warning
139149 | ^^^^^^^^^
140150
141151error: unreachable pattern
142- --> $DIR/consts-opaque.rs:103 :9
152+ --> $DIR/consts-opaque.rs:105 :9
143153 |
144154LL | _ => {} // should not be emitting unreachable warning
145155 | ^
146156
147- error: aborting due to 22 previous errors
157+ error: aborting due to 22 previous errors; 1 warning emitted
148158
0 commit comments