1 error[E0713]: borrow may still be in use when destructor runs
2 --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:11:5
4 LL | fn finish_1(s: S) -> &mut String {
7 | ^^^^^ returning this value requires that `*s.url` is borrowed for `'1`
9 | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
11 error[E0713]: borrow may still be in use when destructor runs
12 --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:16:13
14 LL | fn finish_2(s: S) -> &mut String {
16 LL | let p = &mut *s.url; p
17 | ^^^^^^^^^^^ - returning this value requires that `*s.url` is borrowed for `'1`
19 | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
21 error[E0713]: borrow may still be in use when destructor runs
22 --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:21:21
24 LL | fn finish_3(s: S) -> &mut String {
26 LL | let p: &mut _ = s.url; p
27 | ^^^^^ - returning this value requires that `*s.url` is borrowed for `'1`
29 | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
31 error[E0509]: cannot move out of type `S<'_>`, which implements the `Drop` trait
32 --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:26:13
37 | cannot move out of here
38 | move occurs because `s.url` has type `&mut String`, which does not implement the `Copy` trait
40 help: consider borrowing here
42 LL | let p = &s.url; p
45 error: aborting due to 4 previous errors
47 Some errors have detailed explanations: E0509, E0713.
48 For more information about an error, try `rustc --explain E0509`.