Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active February 1, 2022 21:16
Show Gist options
  • Save ihcsim/15c10c60470c8fde04bf05e59c5d045c to your computer and use it in GitHub Desktop.
Save ihcsim/15c10c60470c8fde04bf05e59c5d045c to your computer and use it in GitHub Desktop.
$ cargo run
Compiling rust-ownership v0.1.0 (/home/isim/rust-ownership)
error[E0382]: borrow of moved value: `s`
--> src/main.rs:26:9
|
25 | let s = "some data".to_string();
| - move occurs because `s` has type `String`, which does not implement the `Copy` trait
26 | (s, s.len())
| - ^^^^^^^ value borrowed here after move
| |
| value moved here
For more information about this error, try `rustc --explain E0382`.
error: could not compile `rust-ownership` due to previous error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment