]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/destructor-restrictions.rs
Rollup merge of #93112 - pietroalbini:pa-cve-2022-21658-nightly, r=pietroalbini
[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 }