Sign in
fuchsia
/
third_party
/
rust
/
7de9402b77ded0d8ec9e1c554521b2121449ef2b
/
.
/
src
/
test
/
ui
/
transmute
/
transmute-imut-to-mut.rs
blob: 8e34e0ae8c74d410533ec059f10370c8ac5c34f4 [
file
] [
log
] [
blame
]
// Tests that transmuting from &T to &mut T is Undefined Behavior.
use
std
::
mem
::
transmute
;
fn
main
()
{
let
_a
:
&
mut
u8
=
unsafe
{
transmute
(&
1u8
)
};
//~^ ERROR mutating transmuted &mut T from &T may cause undefined behavior
}