/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
- // -*- rust -*-
- // error-pattern:bounds check
- fn main() {
- let s: ~str = ~"hello";
- // Bounds-check failure.
- assert (s[5] == 0x0 as u8);
- }