]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs
Merge commit '4a053f206fd6799a25823c307f7d7f9d897be118' into sync-rustfmt-subtree
[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 }