1 error[E0658]: `if` is not allowed in a `const`
2 --> $DIR/feature-gate-const-if-match.rs:10:16
4 LL | const _: i32 = if true {
12 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
13 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
15 error[E0658]: `if` is not allowed in a `const`
16 --> $DIR/feature-gate-const-if-match.rs:16:16
18 LL | const _: i32 = if let Some(true) = Some(false) {
26 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
27 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
29 error[E0658]: `match` is not allowed in a `const`
30 --> $DIR/feature-gate-const-if-match.rs:22:16
32 LL | const _: i32 = match 1 {
40 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
41 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
43 error[E0658]: `if` is not allowed in a `static`
44 --> $DIR/feature-gate-const-if-match.rs:29:13
46 LL | let x = if true { 0 } else { 1 };
47 | ^^^^^^^^^^^^^^^^^^^^^^^^
49 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
50 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
52 error[E0658]: `match` is not allowed in a `static`
53 --> $DIR/feature-gate-const-if-match.rs:31:13
55 LL | let x = match x { 0 => 1, _ => 0 };
56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
58 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
59 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
61 error[E0658]: `if` is not allowed in a `static`
62 --> $DIR/feature-gate-const-if-match.rs:33:5
64 LL | if let Some(x) = Some(x) { x } else { 1 }
65 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
68 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
70 error[E0658]: `if` is not allowed in a `static mut`
71 --> $DIR/feature-gate-const-if-match.rs:38:13
73 LL | let x = if true { 0 } else { 1 };
74 | ^^^^^^^^^^^^^^^^^^^^^^^^
76 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
77 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
79 error[E0658]: `match` is not allowed in a `static mut`
80 --> $DIR/feature-gate-const-if-match.rs:40:13
82 LL | let x = match x { 0 => 1, _ => 0 };
83 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
85 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
86 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
88 error[E0658]: `if` is not allowed in a `static mut`
89 --> $DIR/feature-gate-const-if-match.rs:42:5
91 LL | if let Some(x) = Some(x) { x } else { 1 }
92 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
95 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
97 error[E0658]: `if` is not allowed in a `const fn`
98 --> $DIR/feature-gate-const-if-match.rs:47:5
100 LL | if true { 5 } else { 6 }
101 | ^^^^^^^^^^^^^^^^^^^^^^^^
103 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
104 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
106 error[E0658]: `if` is not allowed in a `const fn`
107 --> $DIR/feature-gate-const-if-match.rs:51:5
109 LL | / if let Some(true) = a {
116 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
117 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
119 error[E0658]: `match` is not allowed in a `const fn`
120 --> $DIR/feature-gate-const-if-match.rs:59:5
123 LL | | i if i > 10 => i,
129 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
130 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
132 error[E0658]: `if` is not allowed in a `const fn`
133 --> $DIR/feature-gate-const-if-match.rs:90:17
135 LL | let x = if y { 0 } else { 1 };
136 | ^^^^^^^^^^^^^^^^^^^^^
138 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
139 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
141 error[E0658]: `match` is not allowed in a `const fn`
142 --> $DIR/feature-gate-const-if-match.rs:92:17
144 LL | let x = match x { 0 => 1, _ => 0 };
145 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
147 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
148 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
150 error[E0658]: `if` is not allowed in a `const fn`
151 --> $DIR/feature-gate-const-if-match.rs:94:9
153 LL | if let Some(x) = Some(x) { x } else { 1 }
154 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
157 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
159 error[E0658]: `if` is not allowed in a `const`
160 --> $DIR/feature-gate-const-if-match.rs:110:17
162 LL | let x = if false { 0 } else { 1 };
163 | ^^^^^^^^^^^^^^^^^^^^^^^^^
165 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
166 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
168 error[E0658]: `match` is not allowed in a `const`
169 --> $DIR/feature-gate-const-if-match.rs:112:17
171 LL | let x = match x { 0 => 1, _ => 0 };
172 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
174 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
175 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
177 error[E0658]: `if` is not allowed in a `const`
178 --> $DIR/feature-gate-const-if-match.rs:114:9
180 LL | if let Some(x) = Some(x) { x } else { 1 }
181 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
184 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
186 error[E0658]: `if` is not allowed in a `const`
187 --> $DIR/feature-gate-const-if-match.rs:67:21
189 LL | const IF: i32 = if true { 5 } else { 6 };
190 | ^^^^^^^^^^^^^^^^^^^^^^^^
192 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
193 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
195 error[E0658]: `if` is not allowed in a `const`
196 --> $DIR/feature-gate-const-if-match.rs:70:25
198 LL | const IF_LET: i32 = if let Some(true) = None { 5 } else { 6 };
199 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
201 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
202 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
204 error[E0658]: `match` is not allowed in a `const`
205 --> $DIR/feature-gate-const-if-match.rs:73:24
207 LL | const MATCH: i32 = match 0 { 1 => 2, _ => 0 };
208 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
210 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
211 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
213 error[E0658]: `if` is not allowed in a `const`
214 --> $DIR/feature-gate-const-if-match.rs:78:21
216 LL | const IF: i32 = if true { 5 } else { 6 };
217 | ^^^^^^^^^^^^^^^^^^^^^^^^
219 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
220 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
222 error[E0658]: `if` is not allowed in a `const`
223 --> $DIR/feature-gate-const-if-match.rs:81:25
225 LL | const IF_LET: i32 = if let Some(true) = None { 5 } else { 6 };
226 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
228 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
229 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
231 error[E0658]: `match` is not allowed in a `const`
232 --> $DIR/feature-gate-const-if-match.rs:84:24
234 LL | const MATCH: i32 = match 0 { 1 => 2, _ => 0 };
235 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
237 = note: for more information, see https://github.com/rust-lang/rust/issues/49146
238 = help: add `#![feature(const_if_match)]` to the crate attributes to enable
240 error[E0019]: constant contains unimplemented expression type
241 --> $DIR/feature-gate-const-if-match.rs:114:21
243 LL | if let Some(x) = Some(x) { x } else { 1 }
246 error: aborting due to 25 previous errors
248 Some errors have detailed explanations: E0019, E0658.
249 For more information about an error, try `rustc --explain E0019`.