Last active
December 11, 2015 11:38
-
-
Save jakerr/4594995 to your computer and use it in GitHub Desktop.
This file contains 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 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)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ rustc --version
rustc 0.6 (09bb07b 2012-12-24 18:29:02 -0800)
host: x86_64-apple-darwin