| -- move occurs because `s1` has type `String`, which does not implement the `Copy` trait
3 | let s2 = s1;
3 | let s2 = s1;
| -- value moved here
| -- value moved here
4 |
4 |
5 | println!("{}, world!", s1);
5 | println!("{}, world!", s1);
| ^^ value used here after move
| ^^ value borrowed here after move
|
|
= note: move occurs because `s1` has type `std::string::String`, which does
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
not implement the `Copy` trait
help: consider cloning the value if the performance cost is acceptable
|
3 | let s2 = s1.clone();
| ++++++++
For more information about this error, try `rustc --explain E0382`.