2018-09-17 19:03:54 -05:00
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2019-09-06 09:23:00 -05:00
|
|
|
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:11:5
|
2018-09-17 19:03:54 -05:00
|
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | fn finish_1(s: S) -> &mut String {
|
|
|
|
| - has type `S<'1>`
|
2018-09-17 19:03:54 -05:00
|
|
|
LL | s.url
|
2018-10-14 09:12:02 -05:00
|
|
|
| ^^^^^ returning this value requires that `*s.url` is borrowed for `'1`
|
2018-09-17 19:03:54 -05:00
|
|
|
LL | }
|
|
|
|
| - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
|
|
|
|
|
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2019-09-06 09:23:00 -05:00
|
|
|
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:16:13
|
2018-09-17 19:03:54 -05:00
|
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | fn finish_2(s: S) -> &mut String {
|
|
|
|
| - has type `S<'1>`
|
2018-09-17 19:03:54 -05:00
|
|
|
LL | let p = &mut *s.url; p
|
2018-10-14 09:12:02 -05:00
|
|
|
| ^^^^^^^^^^^ - returning this value requires that `*s.url` is borrowed for `'1`
|
2018-09-17 19:03:54 -05:00
|
|
|
LL | }
|
|
|
|
| - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
|
|
|
|
|
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2019-09-06 09:23:00 -05:00
|
|
|
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:21:21
|
2018-09-17 19:03:54 -05:00
|
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | fn finish_3(s: S) -> &mut String {
|
|
|
|
| - has type `S<'1>`
|
2018-09-17 19:03:54 -05:00
|
|
|
LL | let p: &mut _ = s.url; p
|
2018-10-14 09:12:02 -05:00
|
|
|
| ^^^^^ - returning this value requires that `*s.url` is borrowed for `'1`
|
2018-09-17 19:03:54 -05:00
|
|
|
LL | }
|
|
|
|
| - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
|
|
|
|
|
|
|
|
error[E0509]: cannot move out of type `S<'_>`, which implements the `Drop` trait
|
2019-09-06 09:23:00 -05:00
|
|
|
--> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:26:13
|
2018-09-17 19:03:54 -05:00
|
|
|
|
|
|
|
|
LL | let p = s.url; p
|
|
|
|
| ^^^^^
|
|
|
|
| |
|
|
|
|
| cannot move out of here
|
2020-09-02 02:40:56 -05:00
|
|
|
| move occurs because `s.url` has type `&mut String`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | let p = &s.url; p
|
|
|
|
| +
|
2018-09-17 19:03:54 -05:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0509, E0713.
|
2018-09-17 19:03:54 -05:00
|
|
|
For more information about an error, try `rustc --explain E0509`.
|