forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an ICE in the min_const_fn analysis
- Loading branch information
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|