2023-04-25 23:14:33 -05:00
|
|
|
// MIR for `slice_index_usize` after PreCodegen
|
|
|
|
|
|
|
|
fn slice_index_usize(_1: &[u32], _2: usize) -> u32 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug slice => _1;
|
|
|
|
debug index => _2;
|
|
|
|
let mut _0: u32;
|
|
|
|
let mut _3: usize;
|
|
|
|
let mut _4: bool;
|
2023-04-25 23:14:33 -05:00
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_3 = Len((*_1));
|
|
|
|
_4 = Lt(copy _2, copy _3);
|
2023-06-23 11:53:09 -05:00
|
|
|
assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, copy _2) -> [success: bb1, unwind continue];
|
2023-04-25 23:14:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_0 = copy (*_1)[_2];
|
|
|
|
return;
|
2023-04-25 23:14:33 -05:00
|
|
|
}
|
|
|
|
}
|