Created
March 26, 2018 12:39
-
-
Save CodeSandwich/a92a81bb924cc81b259629788a7a01d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn value_moved_during_borrow_lifetime() { | |
let value = "abc".to_string(); // crate value | |
let borrow = &value; // create borrow | |
let my_box = Box::new(value); // <COMPILE TIME FAIL> move of value | |
// while borrowed | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment