summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/issue-58776-borrowck-scans-children.rs')
-rw-r--r--tests/ui/borrowck/issue-58776-borrowck-scans-children.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs b/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs
new file mode 100644
index 000000000..efa313a9d
--- /dev/null
+++ b/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs
@@ -0,0 +1,11 @@
+fn main() {
+ let mut greeting = "Hello world!".to_string();
+ let res = (|| (|| &greeting)())();
+
+ greeting = "DEALLOCATED".to_string();
+ //~^ ERROR cannot assign
+ drop(greeting);
+ //~^ ERROR cannot move
+
+ println!("thread result: {:?}", res);
+}