Sign in
fuchsia
/
third_party
/
rust
/
9d09331e00b02f81c714b0c41ce3a38380dd36a2
/
.
/
src
/
test
/
ui
/
unboxed-closures
/
unboxed-closures-borrow-conflict.rs
blob: 835a1f598601c1540c8c6a1c88a8e79daeb77c19 [
file
] [
log
] [
blame
]
// Test that an unboxed closure that mutates a free variable will
// cause borrow conflicts.
fn
main
()
{
let
mut
x
=
0
;
let
f
=
||
x
+=
1
;
let
_y
=
x
;
//~ ERROR cannot use `x` because it was mutably borrowed
f
;
}