Skip to content

Instantly share code, notes, and snippets.

@jakerr
Last active December 11, 2015 11:38
Show Gist options
  • Save jakerr/4594995 to your computer and use it in GitHub Desktop.
Save jakerr/4594995 to your computer and use it in GitHub Desktop.
fn main() {
let mut orig = @1;
let mut borrow = &*orig;
io::println(fmt!("before mutate, orig: %? borrow: %?", orig, borrow));
orig = @2;
borrow = &3; // rustc gives error here, but hangs and takes 100% cpu and eventually takes 100% of memory
// error: illegal borrow: borrowed value does not live long enough
io::println(fmt!("after mutate, orig: %? borrow: %?", orig, borrow));
}
@jakerr
Copy link
Author

jakerr commented Jan 22, 2013

$ rustc --version
rustc 0.6 (09bb07b 2012-12-24 18:29:02 -0800)
host: x86_64-apple-darwin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment