Sign in
fuchsia
/
third_party
/
rust
/
9d09331e00b02f81c714b0c41ce3a38380dd36a2
/
.
/
src
/
test
/
ui
/
issues
/
issue-23649-1.rs
blob: fc0c9a605fa8d5e604b4bd8a6de258a72092c66a [
file
] [
log
] [
blame
]
// run-pass
use
std
::
mem
;
pub
struct
X
([
u8
]);
fn
_f
(
x
:
&
X
)
->
usize
{
match
*
x
{
X
(
ref
x
)
=>
{
x
.
len
()
}
}
}
fn
main
()
{
let
b
:
&[
u8
]
=
&[
11
;
42
];
let
v
:
&
X
=
unsafe
{
mem
::
transmute
(
b
)
};
assert_eq
!(
_f
(
v
),
42
);
}