Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
borrowck
/
regions-escape-bound-fn-2.rs
blob: 0e98d98cf87b3f1c36bb297ae8683d2059fca4ed [
file
] [
log
] [
blame
] [
edit
]
fn
with_int
<
F
>(
f
:
F
)
where
F
:
FnOnce
(&
isize
),
{
let
x
=
3
;
f
(&
x
);
}
fn
main
()
{
let
mut
x
=
None
;
with_int
(|
y
|
x
=
Some
(
y
));
//~^ ERROR borrowed data escapes outside of closure
}