Sign in
android
/
toolchain
/
rustc
/
e40e7362ba4208d45fb88525361a7de2fad4bb91
/
.
/
src
/
test
/
ui
/
format-ref-cell.rs
blob: afb2f8488b82aface3710befbc68562149b5542b [
file
] [
log
] [
blame
]
// run-pass
use
std
::
cell
::
RefCell
;
pub
fn
main
()
{
let
name
=
RefCell
::
new
(
"rust"
);
let
what
=
RefCell
::
new
(
"rocks"
);
let
msg
=
format
!(
"{name} {}"
,
&*
what
.
borrow
(),
name
=&*
name
.
borrow
());
assert_eq
!(
msg
,
"rust rocks"
.
to_string
());
}