details in error E0382 changed over time

This commit is contained in:
Krasimir Berov 2017-01-10 23:31:37 +01:00
parent 7328b60b62
commit cc053d91f4

View File

@ -364,14 +364,16 @@ Youll get an error like this because Rust prevents you from using the
invalidated reference:
```text
5:22 error: use of moved value: `s1` [E0382]
println!("{}", s1);
^~
5:24 note: in this expansion of println! (defined in <std macros>)
3:11 note: `s1` moved here because it has type `collections::string::String`,
which is moved by default
let s2 = s1;
^~
error[E0382]: use of moved value: `s1`
--> src/main.rs:4:27
|
3 | let s2 = s1;
| -- value moved here
4 | println!("{}, world!",s1);
| ^^ value used here after move
|
= note: move occurs because `s1` has type `std::string::String`,
which does not implement the `Copy` trait
```
If youve heard the terms “shallow copy” and “deep copy” while working with