Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let x1 = retorna_string();
- let x2 = x1;
- println!("x1: {}, x2: {}", x1, x2);
- }
- fn retorna_string() -> String {
- return String::from("olรก");
- }
- /*
- --> main.rs:4:30
- |
- 3 | let x2 = x1;
- | -- value moved here
- 4 | println!("x1: {}, x2: {}", x1, x2);
- | ^^ value used here after move
- |
- = note: move occurs because `x1` has type `std::string::String`, which does not implement the `Copy` trait
- error: aborting due to previous error
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement