]> git.lizzy.rs Git - rust.git/blob - src/test/run-fail/str-overrun.rs
Auto merge of #63994 - Centril:refactor-qualify-consts, r=spastorino,oli-obk
[rust.git] / src / test / run-fail / str-overrun.rs
1 // error-pattern:index out of bounds: the len is 5 but the index is 5
2 fn main() {
3     let s: String = "hello".to_string();
4
5     // Bounds-check panic.
6     assert_eq!(s.as_bytes()[5], 0x0 as u8);
7 }