aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-fail/vec-underrun.rs
blob: a230d1be7ff7613f7065341883cc7e33b8f08874 (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, 20);
  let int x = 0;
  check (v.(x) == 10);
  // Bounds-check failure.
  check (v.(x-1) == 20);
}