summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs
blob: 0b2372d1274ceabd037bc547b662f24ca7e438ad (plain)
1
2
3
4
5
6
7
8
9
10
fn main() {
    let mut greeting = "Hello world!".to_string();
    let res = (|| (|| &greeting)())();

    greeting = "DEALLOCATED".to_string();
    //~^ ERROR cannot assign
    drop(greeting);

    println!("thread result: {:?}", res);
}