diff options
Diffstat (limited to 'tests/ui/moves/issue-75904-move-closure-loop.rs')
| -rw-r--r-- | tests/ui/moves/issue-75904-move-closure-loop.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/moves/issue-75904-move-closure-loop.rs b/tests/ui/moves/issue-75904-move-closure-loop.rs new file mode 100644 index 00000000000..6641a0376c6 --- /dev/null +++ b/tests/ui/moves/issue-75904-move-closure-loop.rs @@ -0,0 +1,15 @@ +// Regression test for issue #75904 +// Tests that we point at an expression +// that required the upvar to be moved, rather than just borrowed. + +struct NotCopy; + +fn main() { + let mut a = NotCopy; + loop { + || { //~ ERROR use of moved value + &mut a; + a; + }; + } +} |
