]>
git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/src/main.rs
3 let mut s
= String
::from("hello");
5 let r1
= &s
; // no problem
6 let r2
= &s
; // no problem
7 println
!("{} and {}", r1
, r2
);
8 // variables r1 and r2 will not be used after this point
10 let r3
= &mut s
; // no problem