diff options
| author | kennytm <kennytm@gmail.com> | 2018-10-28 16:38:54 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-10-28 21:23:41 +0800 |
| commit | b565e5d5752b995e878b7459ecea081d3e3b0dbd (patch) | |
| tree | 5a4cef7c4cad94486e0f84e355a396399ab958f4 /src/test | |
| parent | 7a95c285f7f7bdfac53fe06819f39fdea2eb0288 (diff) | |
| parent | c04893afbb1bccc2ceeccdd7b7f46e5cb5dc126d (diff) | |
| download | rust-b565e5d5752b995e878b7459ecea081d3e3b0dbd.tar.gz rust-b565e5d5752b995e878b7459ecea081d3e3b0dbd.zip | |
Rollup merge of #55412 - oli-obk:min_const_fn_ice, r=estebank
Fix an ICE in the min_const_fn analysis fixes https://github.com/rust-lang/rust/issues/55395 cc @Centril
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/consts/single_variant_match_ice.rs | 15 | ||||
| -rw-r--r-- | src/test/ui/consts/single_variant_match_ice.stderr | 8 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/consts/single_variant_match_ice.rs b/src/test/ui/consts/single_variant_match_ice.rs new file mode 100644 index 00000000000..67a41bc5dc4 --- /dev/null +++ b/src/test/ui/consts/single_variant_match_ice.rs @@ -0,0 +1,15 @@ +enum Foo { + Prob, +} + +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 + } + } +} + +fn main() {} diff --git a/src/test/ui/consts/single_variant_match_ice.stderr b/src/test/ui/consts/single_variant_match_ice.stderr new file mode 100644 index 00000000000..a0222b0d489 --- /dev/null +++ b/src/test/ui/consts/single_variant_match_ice.stderr @@ -0,0 +1,8 @@ +error: `if`, `match`, `&&` and `||` are not stable in const fn + --> $DIR/single_variant_match_ice.rs:10:13 + | +LL | Prob => 0x1, //~ ERROR `if`, `match`, `&&` and `||` are not stable in const fn + | ^^^^ + +error: aborting due to previous error + |
