]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-58776-borrowck-scans-children.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / 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 }