summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/issue-52663-span-decl-captured-variable.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/nll/issue-52663-span-decl-captured-variable.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/nll/issue-52663-span-decl-captured-variable.rs b/src/test/ui/nll/issue-52663-span-decl-captured-variable.rs
new file mode 100644
index 000000000..cd1f457a1
--- /dev/null
+++ b/src/test/ui/nll/issue-52663-span-decl-captured-variable.rs
@@ -0,0 +1,11 @@
+fn expect_fn<F>(f: F) where F : Fn() {
+ f();
+}
+
+fn main() {
+ {
+ let x = (vec![22], vec![44]);
+ expect_fn(|| drop(x.0));
+ //~^ ERROR cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure [E0507]
+ }
+}