aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-fail/vec-overrun.rs
blob: 810feb39bcd9e502ed614514d86102303e5b6e3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
// xfail-stage0
// -*- 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);
}