rust/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir
Matthew Jasper a277c901d9 Remove MIR unsafe check
This also remove safety information from MIR.
2024-04-03 08:50:12 +00:00

123 lines
3.1 KiB
Rust

// MIR for `forward_loop` after PreCodegen
fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
debug start => _1;
debug end => _2;
debug f => _3;
let mut _0: ();
let mut _4: std::ops::Range<u32>;
let mut _5: std::ops::Range<u32>;
let mut _6: &mut std::ops::Range<u32>;
let mut _14: std::option::Option<u32>;
let mut _16: &impl Fn(u32);
let mut _17: (u32,);
let _18: ();
scope 1 {
debug iter => _5;
let _15: u32;
scope 2 {
debug x => _15;
}
scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) {
debug self => _6;
scope 5 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) {
debug self => _6;
let mut _7: &u32;
let mut _8: &u32;
let mut _11: bool;
let _12: u32;
let mut _13: u32;
scope 6 {
debug old => _12;
}
scope 7 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) {
debug self => _7;
debug other => _8;
let mut _9: u32;
let mut _10: u32;
}
}
}
}
scope 3 (inlined <std::ops::Range<u32> as IntoIterator>::into_iter) {
debug self => _4;
}
bb0: {
_4 = std::ops::Range::<u32> { start: _1, end: _2 };
StorageLive(_5);
_5 = _4;
goto -> bb1;
}
bb1: {
StorageLive(_14);
_6 = &mut _5;
StorageLive(_12);
StorageLive(_11);
StorageLive(_7);
_7 = &(_5.0: u32);
StorageLive(_8);
_8 = &(_5.1: u32);
StorageLive(_9);
_9 = (_5.0: u32);
StorageLive(_10);
_10 = (_5.1: u32);
_11 = Lt(move _9, move _10);
StorageDead(_10);
StorageDead(_9);
switchInt(move _11) -> [0: bb2, otherwise: bb4];
}
bb2: {
StorageDead(_8);
StorageDead(_7);
StorageDead(_11);
StorageDead(_12);
StorageDead(_14);
StorageDead(_5);
drop(_3) -> [return: bb3, unwind continue];
}
bb3: {
return;
}
bb4: {
StorageDead(_8);
StorageDead(_7);
_12 = (_5.0: u32);
StorageLive(_13);
_13 = <u32 as Step>::forward_unchecked(_12, const 1_usize) -> [return: bb5, unwind: bb7];
}
bb5: {
(_5.0: u32) = move _13;
StorageDead(_13);
_14 = Option::<u32>::Some(_12);
StorageDead(_11);
StorageDead(_12);
_15 = ((_14 as Some).0: u32);
StorageLive(_16);
_16 = &_3;
StorageLive(_17);
_17 = (_15,);
_18 = <impl Fn(u32) as Fn<(u32,)>>::call(move _16, move _17) -> [return: bb6, unwind: bb7];
}
bb6: {
StorageDead(_17);
StorageDead(_16);
StorageDead(_14);
goto -> bb1;
}
bb7 (cleanup): {
drop(_3) -> [return: bb8, unwind terminate(cleanup)];
}
bb8 (cleanup): {
resume;
}
}