|
| 1 | +error[E0506]: cannot assign to `x` because it is borrowed (Ast) |
| 2 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:24:5 |
| 3 | + | |
| 4 | +23 | let wrap = Wrap { p: &mut x }; |
| 5 | + | - borrow of `x` occurs here |
| 6 | +24 | x += 1; //~ ERROR because of dtor |
| 7 | + | ^^^^^^ assignment to borrowed `x` occurs here |
| 8 | + |
| 9 | +error[E0506]: cannot assign to `x` because it is borrowed (Ast) |
| 10 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:31:5 |
| 11 | + | |
| 12 | +29 | let wrap = Wrap { p: &mut x }; |
| 13 | + | - borrow of `x` occurs here |
| 14 | +30 | std::mem::drop(wrap); |
| 15 | +31 | x += 1; // OK, drop is inert |
| 16 | + | ^^^^^^ assignment to borrowed `x` occurs here |
| 17 | + |
| 18 | +error[E0506]: cannot assign to `x` because it is borrowed (Mir) |
| 19 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:24:5 |
| 20 | + | |
| 21 | +23 | let wrap = Wrap { p: &mut x }; |
| 22 | + | ------ borrow of `x` occurs here |
| 23 | +24 | x += 1; //~ ERROR because of dtor |
| 24 | + | ^^^^^^ assignment to borrowed `x` occurs here |
| 25 | + |
| 26 | +error[E0503]: cannot use `x` because it was mutably borrowed (Mir) |
| 27 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:24:5 |
| 28 | + | |
| 29 | +23 | let wrap = Wrap { p: &mut x }; |
| 30 | + | ------ borrow of `x` occurs here |
| 31 | +24 | x += 1; //~ ERROR because of dtor |
| 32 | + | ^^^^^^ use of borrowed `x` |
| 33 | + |
| 34 | +error[E0506]: cannot assign to `x` because it is borrowed (Mir) |
| 35 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:25:2 |
| 36 | + | |
| 37 | +23 | let wrap = Wrap { p: &mut x }; |
| 38 | + | ------ borrow of `x` occurs here |
| 39 | +24 | x += 1; //~ ERROR because of dtor |
| 40 | +25 | } |
| 41 | + | ^ assignment to borrowed `x` occurs here |
| 42 | + |
| 43 | +error[E0506]: cannot assign to `x` because it is borrowed (Mir) |
| 44 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:31:5 |
| 45 | + | |
| 46 | +29 | let wrap = Wrap { p: &mut x }; |
| 47 | + | ------ borrow of `x` occurs here |
| 48 | +30 | std::mem::drop(wrap); |
| 49 | +31 | x += 1; // OK, drop is inert |
| 50 | + | ^^^^^^ assignment to borrowed `x` occurs here |
| 51 | + |
| 52 | +error[E0503]: cannot use `x` because it was mutably borrowed (Mir) |
| 53 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:31:5 |
| 54 | + | |
| 55 | +29 | let wrap = Wrap { p: &mut x }; |
| 56 | + | ------ borrow of `x` occurs here |
| 57 | +30 | std::mem::drop(wrap); |
| 58 | +31 | x += 1; // OK, drop is inert |
| 59 | + | ^^^^^^ use of borrowed `x` |
| 60 | + |
| 61 | +error[E0506]: cannot assign to `x` because it is borrowed (Mir) |
| 62 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:32:2 |
| 63 | + | |
| 64 | +29 | let wrap = Wrap { p: &mut x }; |
| 65 | + | ------ borrow of `x` occurs here |
| 66 | +... |
| 67 | +32 | } |
| 68 | + | ^ assignment to borrowed `x` occurs here |
| 69 | + |
| 70 | +error[E0506]: cannot assign to `x` because it is borrowed (Mir) |
| 71 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:46:2 |
| 72 | + | |
| 73 | +42 | let wrap = Wrap { p: &mut x }; |
| 74 | + | ------ borrow of `x` occurs here |
| 75 | +... |
| 76 | +46 | } |
| 77 | + | ^ assignment to borrowed `x` occurs here |
| 78 | + |
| 79 | +error[E0506]: cannot assign to `x` because it is borrowed (Mir) |
| 80 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:55:2 |
| 81 | + | |
| 82 | +50 | let wrap = Wrap { p: &mut x }; |
| 83 | + | ------ borrow of `x` occurs here |
| 84 | +... |
| 85 | +55 | } |
| 86 | + | ^ assignment to borrowed `x` occurs here |
| 87 | + |
| 88 | +error[E0506]: cannot assign to `x` because it is borrowed (Mir) |
| 89 | + --> /home/paulf/rust/src/test/ui/nll/maybe-initialized-drop.rs:63:2 |
| 90 | + | |
| 91 | +59 | let wrap = Wrap { p: &mut x }; |
| 92 | + | ------ borrow of `x` occurs here |
| 93 | +... |
| 94 | +63 | } |
| 95 | + | ^ assignment to borrowed `x` occurs here |
| 96 | + |
| 97 | +error: aborting due to 11 previous errors |
0 commit comments