trpl-zh-cn/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/src/main.rs

11 lines
173 B
Rust

fn main() {
// ANCHOR: here
let mut s = String::from("hello");
let r1 = &mut s;
let r2 = &mut s;
println!("{}, {}", r1, r2);
// ANCHOR_END: here
}