11error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
2- --> $DIR/consts-opaque.rs:34 :9
2+ --> $DIR/consts-opaque.rs:30 :9
33 |
44LL | FOO => {}
55 | ^^^
66
77error: unreachable pattern
8- --> $DIR/consts-opaque.rs:36 :9
8+ --> $DIR/consts-opaque.rs:32 :9
99 |
1010LL | _ => {} // should not be emitting unreachable warning
1111 | ^
@@ -17,19 +17,19 @@ LL | #![deny(unreachable_patterns)]
1717 | ^^^^^^^^^^^^^^^^^^^^
1818
1919error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
20- --> $DIR/consts-opaque.rs:41 :9
20+ --> $DIR/consts-opaque.rs:37 :9
2121 |
2222LL | FOO_REF => {}
2323 | ^^^^^^^
2424
2525error: unreachable pattern
26- --> $DIR/consts-opaque.rs:43 :9
26+ --> $DIR/consts-opaque.rs:39 :9
2727 |
2828LL | Foo(_) => {} // should not be emitting unreachable warning
2929 | ^^^^^^
3030
3131warning: 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
32+ --> $DIR/consts-opaque.rs:45 :9
3333 |
3434LL | FOO_REF_REF => {}
3535 | ^^^^^^^^^^^
@@ -39,21 +39,21 @@ LL | FOO_REF_REF => {}
3939 = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
4040
4141error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
42- --> $DIR/consts-opaque.rs:57 :9
42+ --> $DIR/consts-opaque.rs:53 :9
4343 |
4444LL | BAR => {} // should not be emitting unreachable warning
4545 | ^^^
4646
4747error: unreachable pattern
48- --> $DIR/consts-opaque.rs:57 :9
48+ --> $DIR/consts-opaque.rs:53 :9
4949 |
5050LL | Bar => {}
5151 | --- matches any value
5252LL | BAR => {} // should not be emitting unreachable warning
5353 | ^^^ unreachable pattern
5454
5555error: unreachable pattern
56- --> $DIR/consts-opaque.rs:60 :9
56+ --> $DIR/consts-opaque.rs:56 :9
5757 |
5858LL | Bar => {}
5959 | --- matches any value
@@ -62,19 +62,19 @@ LL | _ => {}
6262 | ^ unreachable pattern
6363
6464error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
65- --> $DIR/consts-opaque.rs:65 :9
65+ --> $DIR/consts-opaque.rs:61 :9
6666 |
6767LL | BAR => {}
6868 | ^^^
6969
7070error: unreachable pattern
71- --> $DIR/consts-opaque.rs:67 :9
71+ --> $DIR/consts-opaque.rs:63 :9
7272 |
7373LL | Bar => {} // should not be emitting unreachable warning
7474 | ^^^
7575
7676error: unreachable pattern
77- --> $DIR/consts-opaque.rs:69 :9
77+ --> $DIR/consts-opaque.rs:65 :9
7878 |
7979LL | Bar => {} // should not be emitting unreachable warning
8080 | --- matches any value
@@ -83,76 +83,88 @@ LL | _ => {}
8383 | ^ unreachable pattern
8484
8585error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
86- --> $DIR/consts-opaque.rs:74 :9
86+ --> $DIR/consts-opaque.rs:70 :9
8787 |
8888LL | BAR => {}
8989 | ^^^
9090
9191error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
92- --> $DIR/consts-opaque.rs:76 :9
92+ --> $DIR/consts-opaque.rs:72 :9
9393 |
9494LL | BAR => {} // should not be emitting unreachable warning
9595 | ^^^
9696
9797error: unreachable pattern
98- --> $DIR/consts-opaque.rs:76 :9
98+ --> $DIR/consts-opaque.rs:72 :9
9999 |
100100LL | BAR => {} // should not be emitting unreachable warning
101101 | ^^^
102102
103103error: unreachable pattern
104- --> $DIR/consts-opaque.rs:79 :9
104+ --> $DIR/consts-opaque.rs:75 :9
105105 |
106106LL | _ => {} // should not be emitting unreachable warning
107107 | ^
108108
109109error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
110- --> $DIR/consts-opaque.rs:84 :9
110+ --> $DIR/consts-opaque.rs:80 :9
111111 |
112112LL | BAZ => {}
113113 | ^^^
114114
115115error: unreachable pattern
116- --> $DIR/consts-opaque.rs:86 :9
116+ --> $DIR/consts-opaque.rs:82 :9
117117 |
118118LL | Baz::Baz1 => {} // should not be emitting unreachable warning
119119 | ^^^^^^^^^
120120
121121error: unreachable pattern
122- --> $DIR/consts-opaque.rs:88 :9
122+ --> $DIR/consts-opaque.rs:84 :9
123123 |
124124LL | _ => {}
125125 | ^
126126
127127error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
128- --> $DIR/consts-opaque.rs:94 :9
128+ --> $DIR/consts-opaque.rs:90 :9
129129 |
130130LL | BAZ => {}
131131 | ^^^
132132
133133error: unreachable pattern
134- --> $DIR/consts-opaque.rs:96 :9
134+ --> $DIR/consts-opaque.rs:92 :9
135135 |
136136LL | _ => {}
137137 | ^
138138
139139error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
140- --> $DIR/consts-opaque.rs:101 :9
140+ --> $DIR/consts-opaque.rs:97 :9
141141 |
142142LL | BAZ => {}
143143 | ^^^
144144
145145error: unreachable pattern
146- --> $DIR/consts-opaque.rs:103 :9
146+ --> $DIR/consts-opaque.rs:99 :9
147147 |
148148LL | Baz::Baz2 => {} // should not be emitting unreachable warning
149149 | ^^^^^^^^^
150150
151151error: unreachable pattern
152- --> $DIR/consts-opaque.rs:105 :9
152+ --> $DIR/consts-opaque.rs:101 :9
153153 |
154154LL | _ => {} // should not be emitting unreachable warning
155155 | ^
156156
157- error: aborting due to 22 previous errors; 1 warning emitted
157+ error: unreachable pattern
158+ --> $DIR/consts-opaque.rs:127:9
159+ |
160+ LL | WRAPQUUX => {} // detected unreachable because we do inspect the `Wrap` layer
161+ | ^^^^^^^^
162+
163+ error: unreachable pattern
164+ --> $DIR/consts-opaque.rs:141:9
165+ |
166+ LL | WHOKNOWSQUUX => {} // detected unreachable because we do inspect the `WhoKnows` layer
167+ | ^^^^^^^^^^^^
168+
169+ error: aborting due to 24 previous errors; 1 warning emitted
158170
0 commit comments