Sign in
fuchsia
/
third_party
/
rust
/
a22e9ee8d0801f9738533b76a492e94065767cbc
/
.
/
src
/
test
/
run-fail
/
str-overrun.rs
blob: e566308a08767ababa165f2347a2b4709116faf1 [
file
] [
log
] [
blame
]
// error-pattern:index out of bounds: the len is 5 but the index is 5
fn
main
()
{
let
s
:
String
=
"hello"
.
to_string
();
// Bounds-check panic.
assert_eq
!(
s
.
as_bytes
()[
5
],
0x0
as
u8
);
}