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