Sign in
◑
Theme
rust
/
rust
/
3d58b04b2dfc6833cc90988ca4d925fcfa69964f
/
.
/
tests
/
ui
/
interior-mutability
/
interior-mutability.rs
blob: c704acc22af6b449b55e7e59a432d8a00764809b [
file
]
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 `UnsafeCell<i32>` may contain interior mutability and a
}