]> git.lizzy.rs Git - rust.git/blobdiff - 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
index 67a41bc5dc4addaa52b0efeeb9612c3b3f1ebb8d..6002506689e12c8cb3a0a55e57d1637bd7db0643 100644 (file)
@@ -2,12 +2,20 @@ enum Foo {
     Prob,
 }
 
+const FOO: u32 = match Foo::Prob {
+    Foo::Prob => 42, //~ ERROR unimplemented expression type
+};
+
+const BAR: u32 = match Foo::Prob {
+    x => 42, //~ ERROR unimplemented expression type
+};
+
 impl Foo {
     pub const fn as_val(&self) -> u8 {
         use self::Foo::*;
 
         match *self {
-            Prob => 0x1, //~ ERROR `if`, `match`, `&&` and `||` are not stable in const fn
+            Prob => 0x1, //~ ERROR loops and conditional expressions are not stable in const fn
         }
     }
 }