rust/src/test/run-fail/vec-overrun.rs
Marijn Haverbeke 3816e57fd2 Downcase std modules again, move to :: for module dereferencing
This should be a snapshot transition.
2011-05-12 21:30:44 +02:00

14 lines
235 B
Rust

// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-
// error-pattern::bounds check
fn main() {
let vec[int] v = vec(10);
let int x = 0;
assert (v.(x) == 10);
// Bounds-check failure.
assert (v.(x + 2) == 20);
}