Sign in
android
/
toolchain
/
rustc
/
d720b3f2ba07cb42ff7b311589c99daefe3aaa22
/
.
/
tests
/
ui
/
span
/
destructor-restrictions.rs
blob: 7fb348a14bf557361e29a6bc5ae41b5de0492a80 [
file
] [
log
] [
blame
]
// Tests the new destructor semantics.
use
std
::
cell
::
RefCell
;
fn
main
()
{
let
b
=
{
let
a
=
Box
::
new
(
RefCell
::
new
(
4
));
*
a
.
borrow
()
+
1
};
//~^ ERROR `*a` does not live long enough
println
!(
"{}"
,
b
);
}