]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / borrowck / issue-58776-borrowck-scans-children.rs
1 fn main() {
2     let mut greeting = "Hello world!".to_string();
3     let res = (|| (|| &greeting)())();
4
5     greeting = "DEALLOCATED".to_string();
6     //~^ ERROR cannot assign
7     drop(greeting);
8     //~^ ERROR cannot move
9
10     println!("thread result: {:?}", res);
11 }