|
| 1 | +error[E0713]: borrow may still be in use when destructor runs |
| 2 | + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:14:5 |
| 3 | + | |
| 4 | +LL | s.url |
| 5 | + | ^^^^^ |
| 6 | +LL | } |
| 7 | + | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait |
| 8 | + | |
| 9 | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 13:1... |
| 10 | + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:13:1 |
| 11 | + | |
| 12 | +LL | / fn finish_1(s: S) -> &mut String { |
| 13 | +LL | | s.url |
| 14 | +LL | | } |
| 15 | + | |_^ |
| 16 | + |
| 17 | +error[E0713]: borrow may still be in use when destructor runs |
| 18 | + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:19:13 |
| 19 | + | |
| 20 | +LL | let p = &mut *s.url; p |
| 21 | + | ^^^^^^^^^^^ |
| 22 | +LL | } |
| 23 | + | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait |
| 24 | + | |
| 25 | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 18:1... |
| 26 | + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:18:1 |
| 27 | + | |
| 28 | +LL | / fn finish_2(s: S) -> &mut String { |
| 29 | +LL | | let p = &mut *s.url; p |
| 30 | +LL | | } |
| 31 | + | |_^ |
| 32 | + |
| 33 | +error[E0713]: borrow may still be in use when destructor runs |
| 34 | + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:24:21 |
| 35 | + | |
| 36 | +LL | let p: &mut _ = s.url; p |
| 37 | + | ^^^^^ |
| 38 | +LL | } |
| 39 | + | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait |
| 40 | + | |
| 41 | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 23:1... |
| 42 | + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:23:1 |
| 43 | + | |
| 44 | +LL | / fn finish_3(s: S) -> &mut String { |
| 45 | +LL | | let p: &mut _ = s.url; p |
| 46 | +LL | | } |
| 47 | + | |_^ |
| 48 | + |
| 49 | +error[E0509]: cannot move out of type `S<'_>`, which implements the `Drop` trait |
| 50 | + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:29:13 |
| 51 | + | |
| 52 | +LL | let p = s.url; p |
| 53 | + | ^^^^^ |
| 54 | + | | |
| 55 | + | cannot move out of here |
| 56 | + | help: consider borrowing here: `&s.url` |
| 57 | + |
| 58 | +error: aborting due to 4 previous errors |
| 59 | + |
| 60 | +Some errors occurred: E0509, E0713. |
| 61 | +For more information about an error, try `rustc --explain E0509`. |
0 commit comments