Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active January 31, 2022 23:07
Show Gist options
  • Save ihcsim/15f49c3ac04d722d4ff9882dac6d943a to your computer and use it in GitHub Desktop.
Save ihcsim/15f49c3ac04d722d4ff9882dac6d943a to your computer and use it in GitHub Desktop.
$ cargo run
Compiling rust-ownership v0.1.0 (/home/isim/rust-ownership)
error[E0505]: cannot move out of `str` because it is borrowed
--> src/main.rs:3:62
|
3 | println!("original: {}\nupdated: {}", str, append_suffix(str));
| ---------------------------------------------------------^^^--
| | | |
| | | move out of `str` occurs here
| | borrow of `str` occurs here
| borrow later used here
For more information about this error, try `rustc --explain E0505`.
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