summary refs log tree commit diff
path: root/src/test/run-fail/str-overrun.rs
blob: d9485f3a2896f8c2b4c17b07f3a51326bbfde121 (plain)
1
2
3
4
5
6
7
8
9
// -*- rust -*-

// error-pattern:index out of bounds: the len is 5 but the index is 5
fn main() {
    let s: ~str = ~"hello";

    // Bounds-check failure.
    assert (s[5] == 0x0 as u8);
}