Skip to content

Instantly share code, notes, and snippets.

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