blob: 12955aed1fbbe242b22061e33e0df6f5731cd49d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// unit-test: LowerSliceLenCalls
// EMIT_MIR lower_slice_len.bound.LowerSliceLenCalls.diff
pub fn bound(index: usize, slice: &[u8]) -> u8 {
if index < slice.len() {
slice[index]
} else {
42
}
}
fn main() {
let _ = bound(1, &[1, 2, 3]);
}
|