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.
16 lines
558 B
16 lines
558 B
3 years ago
|
$ cargo run
|
||
|
Compiling ownership v0.1.0 (file:///projects/ownership)
|
||
|
error[E0499]: cannot borrow `s` as mutable more than once at a time
|
||
|
--> src/main.rs:5:14
|
||
|
|
|
||
|
4 | let r1 = &mut s;
|
||
|
| ------ first mutable borrow occurs here
|
||
|
5 | let r2 = &mut s;
|
||
|
| ^^^^^^ second mutable borrow occurs here
|
||
|
6 |
|
||
|
7 | println!("{}, {}", r1, r2);
|
||
|
| -- first borrow later used here
|
||
|
|
||
|
For more information about this error, try `rustc --explain E0499`.
|
||
|
error: could not compile `ownership` due to previous error
|