]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/single_variant_match_ice.rs
Reword const fn conditional and loop error text
[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 {
6     Foo::Prob => 42, //~ ERROR unimplemented expression type
7 };
8
9 const BAR: u32 = match Foo::Prob {
10     x => 42, //~ ERROR unimplemented expression type
11 };
12
13 impl Foo {
14     pub const fn as_val(&self) -> u8 {
15         use self::Foo::*;
16
17         match *self {
18             Prob => 0x1, //~ ERROR loops and conditional expressions are not stable in const fn
19         }
20     }
21 }
22
23 fn main() {}