]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/destructor-restrictions.rs
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
[rust.git] / src / test / ui / span / destructor-restrictions.rs
1 // Tests the new destructor semantics.
2
3 use std::cell::RefCell;
4
5 fn main() {
6     let b = {
7         let a = Box::new(RefCell::new(4));
8         *a.borrow() + 1
9     }; //~^ ERROR `*a` does not live long enough
10     println!("{}", b);
11 }