-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #66788 - ecstatic-morse:const-fn-unreachable, r=Centril
Allow `Unreachable` terminators through `min_const_fn` checks Resolves #66756. This allows `Unreachable` terminators through the `min_const_fn` checks if `#![feature(const_if_match)]` is enabled. We could probably just allow them with no feature flag, but it seems okay to be conservative here. r? @oli-obk
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 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
21 changes: 21 additions & 0 deletions
21
src/test/ui/consts/control-flow/exhaustive-c-like-enum-match.rs
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,21 @@ | ||
// Test for <https://github.com/rust-lang/rust/issues/66756> | ||
|
||
// check-pass | ||
|
||
#![feature(const_if_match)] | ||
|
||
enum E { | ||
A, | ||
B, | ||
C | ||
} | ||
|
||
const fn f(e: E) { | ||
match e { | ||
E::A => {} | ||
E::B => {} | ||
E::C => {} | ||
} | ||
} | ||
|
||
fn main() {} |