Sign in
rust
/
rust-lang
/
cargo
/
refs/heads/try
/
.
/
crates
/
rustfix
/
tests
/
everything
/
closure-immutable-outer-variable.fixed.rs
blob: e443e024b467ac75c6d995a8c853eb808bfa2f3c [
file
] [
log
] [
blame
] [
edit
]
// Point at the captured immutable outer variable
fn
foo
(
mut
f
:
Box
<
dyn
FnMut
()>)
{
f
();
}
fn
main
()
{
let
mut
y
=
true
;
foo
(
Box
::
new
(
move
||
y
=
false
)
as
Box
<
_
>);
//~ ERROR cannot assign to captured outer variable
}