Sign in
fuchsia
/
third_party
/
github.com
/
rust-lang
/
rust
/
refs/tags/1.58.1
/
.
/
src
/
test
/
mir-opt
/
lower_slice_len.rs
blob: f2438e69749905d71f917c13cc180718b495148f [
file
] [
log
] [
blame
]
// compile-flags: -Z mir-opt-level=3
// 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
]);
}