Sign in
rust
/
miri
/
refs/heads/try
/
.
/
tests
/
fail
/
dangling_pointers
/
out_of_bounds_write.rs
blob: 2ff537b1ffc5f3e2904f5102cb06ef5a8c72eefd [
file
] [
log
] [
blame
] [
edit
]
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
}