2023-10-16 12:36:39 -05:00
|
|
|
// skip-filecheck
|
2020-10-03 04:18:24 -05:00
|
|
|
#![feature(min_const_generics)]
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
2023-06-20 05:04:34 -05:00
|
|
|
//@ compile-flags: -Zunsound-mir-opts
|
|
|
|
|
2020-10-03 04:18:24 -05:00
|
|
|
// If const eval fails, then don't crash
|
2023-02-26 07:42:28 -06:00
|
|
|
// EMIT_MIR const_goto_const_eval_fail.f.JumpThreading.diff
|
2020-10-03 04:18:24 -05:00
|
|
|
pub fn f<const A: i32, const B: bool>() -> u64 {
|
|
|
|
match {
|
|
|
|
match A {
|
|
|
|
1 | 2 | 3 => B,
|
|
|
|
_ => true,
|
|
|
|
}
|
|
|
|
} {
|
|
|
|
false => 1,
|
|
|
|
true => 2,
|
|
|
|
}
|
|
|
|
}
|