Sign in
fuchsia
/
third_party
/
rust
/
346aec9b02f3c74f3fce97fd6bda24709d220e49
/
.
/
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
();
}
}