Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
/home/ezyang/Dev/rust-sandbox/test.rs:13:20: 13:27 error: cannot borrow `*z` as mutable more than once at a time
/home/ezyang/Dev/rust-sandbox/test.rs:13 let x = &mut *z;
^~~~~~~
/home/ezyang/Dev/rust-sandbox/test.rs:12:24: 12:25 note: second borrow of `*z` as mutable occurs here
/home/ezyang/Dev/rust-sandbox/test.rs:12 let r = foo(z);
^
/home/ezyang/Dev/rust-sandbox/test.rs:12:24: 12:25 note: old loan gen'd here
/home/ezyang/Dev/rust-sandbox/test.rs:12 let r = foo(z);
^
/home/ezyang/Dev/rust-sandbox/test.rs:7:4: 16:5 note: old loan kill'd here
/home/ezyang/Dev/rust-sandbox/test.rs:7 match x {
/home/ezyang/Dev/rust-sandbox/test.rs:8 &Z(_) => {
/home/ezyang/Dev/rust-sandbox/test.rs:9 fail!()
/home/ezyang/Dev/rust-sandbox/test.rs:10 },
/home/ezyang/Dev/rust-sandbox/test.rs:11 &S(~ref mut z) => {
/home/ezyang/Dev/rust-sandbox/test.rs:12 let r = foo(z);
...
/home/ezyang/Dev/rust-sandbox/test.rs:13:20: 13:27 note: new loan gen'd here
/home/ezyang/Dev/rust-sandbox/test.rs:13 let x = &mut *z;
^~~~~~~
/home/ezyang/Dev/rust-sandbox/test.rs:11:26: 15:9 note: new loan kill'd here
/home/ezyang/Dev/rust-sandbox/test.rs:11 &S(~ref mut z) => {
/home/ezyang/Dev/rust-sandbox/test.rs:12 let r = foo(z);
/home/ezyang/Dev/rust-sandbox/test.rs:13 let x = &mut *z;
/home/ezyang/Dev/rust-sandbox/test.rs:14 r
/home/ezyang/Dev/rust-sandbox/test.rs:15 },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment