Sign in
fuchsia
/
third_party
/
rust
/
20d43d03dd27568f609d621ce44673393e838892
/
.
/
src
/
test
/
ui
/
rfc-0107-bind-by-move-pattern-guards
/
rfc-reject-double-move-in-first-arm.rs
blob: 571f51c9001202ad99efdfd95832249f635d0dab [
file
] [
log
] [
blame
]
struct
A
{
a
:
Box
<
i32
>
}
fn
foo
(
n
:
i32
)
{
let
x
=
A
{
a
:
Box
::
new
(
n
)
};
let
_y
=
match
x
{
A
{
a
:
v
}
if
{
drop
(
v
);
true
}
=>
v
,
//~^ ERROR cannot move out of `v` in pattern guard
_
=>
Box
::
new
(
0
),
};
}
fn
main
()
{
foo
(
107
);
}