]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/usefulness/consts-opaque.stderr
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / pattern / usefulness / consts-opaque.stderr
1 error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
2   --> $DIR/consts-opaque.rs:30:9
3    |
4 LL |         FOO => {}
5    |         ^^^
6
7 error: unreachable pattern
8   --> $DIR/consts-opaque.rs:32:9
9    |
10 LL |         FOO => {}
11    |         --- matches any value
12 LL |
13 LL |         _ => {} // should not be emitting unreachable warning
14    |         ^ unreachable pattern
15    |
16 note: the lint level is defined here
17   --> $DIR/consts-opaque.rs:6:9
18    |
19 LL | #![deny(unreachable_patterns)]
20    |         ^^^^^^^^^^^^^^^^^^^^
21
22 error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
23   --> $DIR/consts-opaque.rs:37:9
24    |
25 LL |         FOO_REF => {}
26    |         ^^^^^^^
27
28 error: unreachable pattern
29   --> $DIR/consts-opaque.rs:39:9
30    |
31 LL |         FOO_REF => {}
32    |         ------- matches any value
33 LL |
34 LL |         Foo(_) => {} // should not be emitting unreachable warning
35    |         ^^^^^^ unreachable pattern
36
37 warning: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
38   --> $DIR/consts-opaque.rs:45:9
39    |
40 LL |         FOO_REF_REF => {}
41    |         ^^^^^^^^^^^
42    |
43    = note: `#[warn(indirect_structural_match)]` on by default
44    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
45    = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
46
47 error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
48   --> $DIR/consts-opaque.rs:53:9
49    |
50 LL |         BAR => {} // should not be emitting unreachable warning
51    |         ^^^
52
53 error: unreachable pattern
54   --> $DIR/consts-opaque.rs:53:9
55    |
56 LL |         Bar => {}
57    |         --- matches any value
58 LL |         BAR => {} // should not be emitting unreachable warning
59    |         ^^^ unreachable pattern
60
61 error: unreachable pattern
62   --> $DIR/consts-opaque.rs:56:9
63    |
64 LL |         Bar => {}
65    |         --- matches any value
66 ...
67 LL |         _ => {}
68    |         ^ unreachable pattern
69
70 error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
71   --> $DIR/consts-opaque.rs:61:9
72    |
73 LL |         BAR => {}
74    |         ^^^
75
76 error: unreachable pattern
77   --> $DIR/consts-opaque.rs:63:9
78    |
79 LL |         BAR => {}
80    |         --- matches any value
81 LL |
82 LL |         Bar => {} // should not be emitting unreachable warning
83    |         ^^^ unreachable pattern
84
85 error: unreachable pattern
86   --> $DIR/consts-opaque.rs:65:9
87    |
88 LL |         BAR => {}
89    |         --- matches any value
90 ...
91 LL |         _ => {}
92    |         ^ unreachable pattern
93
94 error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
95   --> $DIR/consts-opaque.rs:70:9
96    |
97 LL |         BAR => {}
98    |         ^^^
99
100 error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
101   --> $DIR/consts-opaque.rs:72:9
102    |
103 LL |         BAR => {} // should not be emitting unreachable warning
104    |         ^^^
105
106 error: unreachable pattern
107   --> $DIR/consts-opaque.rs:72:9
108    |
109 LL |         BAR => {}
110    |         --- matches any value
111 LL |
112 LL |         BAR => {} // should not be emitting unreachable warning
113    |         ^^^ unreachable pattern
114
115 error: unreachable pattern
116   --> $DIR/consts-opaque.rs:75:9
117    |
118 LL |         BAR => {}
119    |         --- matches any value
120 ...
121 LL |         _ => {} // should not be emitting unreachable warning
122    |         ^ unreachable pattern
123
124 error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
125   --> $DIR/consts-opaque.rs:80:9
126    |
127 LL |         BAZ => {}
128    |         ^^^
129
130 error: unreachable pattern
131   --> $DIR/consts-opaque.rs:82:9
132    |
133 LL |         BAZ => {}
134    |         --- matches any value
135 LL |
136 LL |         Baz::Baz1 => {} // should not be emitting unreachable warning
137    |         ^^^^^^^^^ unreachable pattern
138
139 error: unreachable pattern
140   --> $DIR/consts-opaque.rs:84:9
141    |
142 LL |         BAZ => {}
143    |         --- matches any value
144 ...
145 LL |         _ => {}
146    |         ^ unreachable pattern
147
148 error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
149   --> $DIR/consts-opaque.rs:90:9
150    |
151 LL |         BAZ => {}
152    |         ^^^
153
154 error: unreachable pattern
155   --> $DIR/consts-opaque.rs:92:9
156    |
157 LL |         BAZ => {}
158    |         --- matches any value
159 LL |
160 LL |         _ => {}
161    |         ^ unreachable pattern
162
163 error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
164   --> $DIR/consts-opaque.rs:97:9
165    |
166 LL |         BAZ => {}
167    |         ^^^
168
169 error: unreachable pattern
170   --> $DIR/consts-opaque.rs:99:9
171    |
172 LL |         BAZ => {}
173    |         --- matches any value
174 LL |
175 LL |         Baz::Baz2 => {} // should not be emitting unreachable warning
176    |         ^^^^^^^^^ unreachable pattern
177
178 error: unreachable pattern
179   --> $DIR/consts-opaque.rs:101:9
180    |
181 LL |         BAZ => {}
182    |         --- matches any value
183 ...
184 LL |         _ => {} // should not be emitting unreachable warning
185    |         ^ unreachable pattern
186
187 error: unreachable pattern
188   --> $DIR/consts-opaque.rs:127:9
189    |
190 LL |         Wrap(_) => {}
191    |         ------- matches any value
192 LL |         WRAPQUUX => {} // detected unreachable because we do inspect the `Wrap` layer
193    |         ^^^^^^^^ unreachable pattern
194
195 error: unreachable pattern
196   --> $DIR/consts-opaque.rs:141:9
197    |
198 LL |         WHOKNOWSQUUX => {} // detected unreachable because we do inspect the `WhoKnows` layer
199    |         ^^^^^^^^^^^^
200
201 error: aborting due to 24 previous errors; 1 warning emitted
202