Sign in
android
/
toolchain
/
rustc
/
5139364148b53d79de1b5e778004d41a6a33a4a2
/
.
/
tests
/
ui
/
borrowck
/
borrowck-move-subcomponent.rs
blob: 38abd19322215207241335a1a8431f8277d89606 [
file
] [
log
] [
blame
]
// Tests that the borrow checker checks all components of a path when moving
// out.
struct
S
{
x
:
Box
<
isize
>
}
fn
f
<
T
>(
_
:
T
)
{}
fn
main
()
{
let
a
:
S
=
S
{
x
:
Box
::
new
(
1
)
};
let
pb
=
&
a
;
let
S
{
x
:
ax
}
=
a
;
//~ ERROR cannot move out
f
(
pb
);
}