blob: 2b00ff15581f1a541c6a1dcb3167834d83e0e32e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// ignore-wasm32 compiled with panic=abort by default
// unit-test: CopyProp
// EMIT_MIR issue_107511.main.CopyProp.diff
fn main() {
let mut sum = 0;
let a = [0, 10, 20, 30];
// `i` is assigned in a loop. Only removing its `StorageDead` would mean that
// execution sees repeated `StorageLive`. This would be UB.
for i in 0..a.len() {
sum += a[i];
}
}
|