summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs')
-rw-r--r--src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs b/src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs
new file mode 100644
index 000000000..efa313a9d
--- /dev/null
+++ b/src/test/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);
+}