Sign in
android
/
toolchain
/
rustc
/
5139364148b53d79de1b5e778004d41a6a33a4a2
/
.
/
src
/
tools
/
miri
/
tests
/
fail
/
dangling_pointers
/
out_of_bounds_write.rs
blob: 2ff537b1ffc5f3e2904f5102cb06ef5a8c72eefd [
file
] [
log
] [
blame
]
fn
main
()
{
let
mut
v
:
Vec
<
u16
>
=
vec
![
1
,
2
];
// This read is also misaligned. We make sure that the OOB message has priority.
unsafe
{
*
v
.
as_mut_ptr
().
wrapping_byte_add
(
5
)
=
0
};
//~ ERROR: out-of-bounds
}