rust/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
266 B
Rust
Raw Normal View History

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);
}