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
This commit is contained in:
kennytm 2018-10-28 16:38:54 +08:00
commit b565e5d575
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C
3 changed files with 26 additions and 2 deletions

View file

@ -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() {}

View file

@ -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