rust/tests/ui/consts/const-eval/issue-52475.rs

12 lines
262 B
Rust
Raw Normal View History

2018-08-18 12:48:14 +00:00
fn main() {
let _ = [(); {
let mut x = &0;
let mut n = 0;
2023-01-04 05:04:03 +00:00
while n < 5 { //~ ERROR evaluation of constant value failed [E0080]
n = (n + 1) % 5;
2018-08-18 12:48:14 +00:00
x = &0; // Materialize a new AllocId
}
0
}];
}