Sign in
android
/
toolchain
/
rustc
/
15a6560abe9880705f51d219c1fa94f880dbaf35
/
.
/
src
/
doc
/
book
/
listings
/
ch04-understanding-ownership
/
no-listing-12-immutable-and-mutable-not-allowed
/
src
/
main.rs
blob: 0da04c010e885b02ea1e8f6f9f88afbb3f69de01 [
file
] [
log
] [
blame
]
fn
main
()
{
// ANCHOR: here
let
mut
s
=
String
::
from
(
"hello"
);
let
r1
=
&
s
;
// no problem
let
r2
=
&
s
;
// no problem
let
r3
=
&
mut
s
;
// BIG PROBLEM
println
!(
"{}, {}, and {}"
,
r1
,
r2
,
r3
);
// ANCHOR_END: here
}