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