Sign in
fuchsia
/
third_party
/
rust
/
9d09331e00b02f81c714b0c41ce3a38380dd36a2
/
.
/
src
/
test
/
ui
/
regions
/
regions-return-ref-to-upvar-issue-17403.rs
blob: 86e759f088a549e7d4aa8f87577810e28b8bb1c7 [
file
] [
log
] [
blame
]
// Test that closures cannot subvert aliasing restrictions
fn
main
()
{
// Unboxed closure case
{
let
mut
x
=
0
;
let
mut
f
=
||
&
mut
x
;
//~ ERROR captured variable cannot escape `FnMut` closure body
let
x
=
f
();
let
y
=
f
();
}
}