]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr
Rollup merge of #60038 - michaelwoerister:pgo-updates-2, r=alexcrichton
[rust.git] / src / test / ui / nll / issue-52059-report-when-borrow-and-drop-conflict.stderr
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 | fn finish_1(s: S) -> &mut String {
5    |             - has type `S<'1>`
6 LL |     s.url
7    |     ^^^^^ returning this value requires that `*s.url` is borrowed for `'1`
8 LL | }
9    | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
10
11 error[E0713]: borrow may still be in use when destructor runs
12   --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:19:13
13    |
14 LL | fn finish_2(s: S) -> &mut String {
15    |             - has type `S<'1>`
16 LL |     let p = &mut *s.url; p
17    |             ^^^^^^^^^^^  - returning this value requires that `*s.url` is borrowed for `'1`
18 LL | }
19    | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
20
21 error[E0713]: borrow may still be in use when destructor runs
22   --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:24:21
23    |
24 LL | fn finish_3(s: S) -> &mut String {
25    |             - has type `S<'1>`
26 LL |     let p: &mut _ = s.url; p
27    |                     ^^^^^  - returning this value requires that `*s.url` is borrowed for `'1`
28 LL | }
29    | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
30
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:29:13
33    |
34 LL |     let p = s.url; p
35    |             ^^^^^
36    |             |
37    |             cannot move out of here
38    |             help: consider borrowing here: `&s.url`
39
40 error: aborting due to 4 previous errors
41
42 Some errors have detailed explanations: E0509, E0713.
43 For more information about an error, try `rustc --explain E0509`.