Open
Description
Basic Code
#![feature(loop_match)]
#[unsafe(no_mangle)]
pub fn break_on_constant_evalution() -> i32 {
let mut state = 0;
#[loop_match]
'a : loop {
state = 'blk: {
match state {
0 => {
break 'a;
},
_ => {
const A: i32 = 0;
#[const_continue]
break 'blk /* constant evaluation */;
}
}
}
}
state
}
- constant operation statment: https://godbolt.org/z/qcsKdqb7a (
expression is not a valid constant Binary
) - const fn call: https://godbolt.org/z/dWaYoP9GE (
expression is not a valid constant Call
) - const block: https://godbolt.org/z/zvs9ePzdj (
cycle detected when building MIR for break_on_constant_evalution
)