2014-10-27 06:58:30 -05:00
|
|
|
// Tests the new destructor semantics.
|
|
|
|
|
|
|
|
use std::cell::RefCell;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let b = {
|
2015-03-03 02:42:26 -06:00
|
|
|
let a = Box::new(RefCell::new(4));
|
2017-11-20 06:13:27 -06:00
|
|
|
*a.borrow() + 1
|
2017-12-13 19:27:23 -06:00
|
|
|
}; //~^ ERROR `*a` does not live long enough
|
2014-10-27 06:58:30 -05:00
|
|
|
println!("{}", b);
|
|
|
|
}
|