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