Sign in
fuchsia
/
third_party
/
rust
/
03222c037142e915e9ea75f681ab98a5a46b8739
/
.
/
src
/
test
/
run-fail
/
vec-overrun.rs
blob: 2be945f736cb7c3782806f6d17e42dc14de427b1 [
file
] [
log
] [
blame
]
// error-pattern:index out of bounds: the len is 1 but the index is 2
fn
main
()
{
let
v
:
Vec
<
isize
>
=
vec
![
10
];
let
x
:
usize
=
0
;
assert_eq
!(
v
[
x
],
10
);
// Bounds-check panic.
assert_eq
!(
v
[
x
+
2
],
20
);
}