]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/single_variant_match_ice.rs
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[rust.git] / src / test / ui / consts / single_variant_match_ice.rs
1 enum Foo {
2     Prob,
3 }
4
5 const FOO: u32 = match Foo::Prob { //~ ERROR unimplemented expression type
6     Foo::Prob => 42,
7 };
8
9 const BAR: u32 = match Foo::Prob { //~ ERROR unimplemented expression type
10     x => 42,
11 };
12
13 impl Foo {
14     pub const fn as_val(&self) -> u8 {
15         use self::Foo::*;
16
17         match *self {
18             //~^ ERROR loops and conditional expressions are not stable in const fn
19             Prob => 0x1,
20         }
21     }
22 }
23
24 fn main() {}