rust/src/test/ui/interior-mutability/interior-mutability.rs
2018-12-25 21:08:33 -07:00

7 lines
224 B
Rust

use std::cell::Cell;
use std::panic::catch_unwind;
fn main() {
let mut x = Cell::new(22);
catch_unwind(|| { x.set(23); });
//~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
}