Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rust: Owner memory example
fn main() {
let name: ~str,
other: ~str;
name = ~"Bob";
other = name;
println(other);
// This won't compile, because 'other' now
// owns the memory, you gave it away.
println(name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.