mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
236 B
12 lines
236 B
3 years ago
|
fn main() {
|
||
|
// ANCHOR: here
|
||
|
let mut s = String::from("hello");
|
||
|
|
||
|
{
|
||
|
let r1 = &mut s;
|
||
|
} // r1 goes out of scope here, so we can make a new reference with no problems.
|
||
|
|
||
|
let r2 = &mut s;
|
||
|
// ANCHOR_END: here
|
||
|
}
|