]> git.lizzy.rs Git - rust.git/blob - tests/ui/str/str-overrun.rs
Rollup merge of #107194 - xfix:remove-slice-internals-dependency-in-rustc-ast, r...
[rust.git] / tests / ui / str / str-overrun.rs
1 // run-fail
2 // error-pattern:index out of bounds: the len is 5 but the index is 5
3 // ignore-emscripten no processes
4
5 fn main() {
6     let s: String = "hello".to_string();
7
8     // Bounds-check panic.
9     assert_eq!(s.as_bytes()[5], 0x0 as u8);
10 }