2019-02-27 15:01:42 -06:00
|
|
|
fn main() {
|
|
|
|
let mut greeting = "Hello world!".to_string();
|
|
|
|
let res = (|| (|| &greeting)())();
|
|
|
|
|
|
|
|
greeting = "DEALLOCATED".to_string();
|
2019-04-07 10:07:36 -05:00
|
|
|
//~^ ERROR cannot assign
|
2019-02-27 15:01:42 -06:00
|
|
|
drop(greeting);
|
2019-04-07 10:07:36 -05:00
|
|
|
//~^ ERROR cannot move
|
2019-02-27 15:01:42 -06:00
|
|
|
|
|
|
|
println!("thread result: {:?}", res);
|
|
|
|
}
|