PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-fail/str-overrun.rs

http://github.com/jruderman/rust
Rust | 9 lines | 4 code | 2 blank | 3 comment | 1 complexity | af2cd1c3f7f08aada117173c7608e827 MD5 | raw file
1// -*- rust -*-
2
3// error-pattern:bounds check
4fn main() {
5    let s: ~str = ~"hello";
6
7    // Bounds-check failure.
8    assert (s[5] == 0x0 as u8);
9}