Sign in
fuchsia
/
third_party
/
rust
/
7de9402b77ded0d8ec9e1c554521b2121449ef2b
/
.
/
src
/
test
/
ui
/
span
/
issue-11925.rs
blob: 0f6472b05f7aae7a228983c17c5ebf6bed70db45 [
file
] [
log
] [
blame
]
#![
feature
(
box_syntax
,
unboxed_closures
)]
fn
to_fn_once
<
A
,
F
:
FnOnce
<
A
>>(
f
:
F
)
->
F
{
f
}
fn
main
()
{
let
r
=
{
let
x
:
Box
<
_
>
=
box
42
;
let
f
=
to_fn_once
(
move
||
&
x
);
//~ ERROR cannot return reference to local data `x`
f
()
};
drop
(
r
);
}