]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / nll / issue-52059-report-when-borrow-and-drop-conflict.stderr
CommitLineData
0bf4aa26 1error[E0713]: borrow may still be in use when destructor runs
e74abb32 2 --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:11:5
0bf4aa26
XL
3 |
4LL | fn finish_1(s: S) -> &mut String {
5 | - has type `S<'1>`
6LL | s.url
7 | ^^^^^ returning this value requires that `*s.url` is borrowed for `'1`
8LL | }
9 | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
10
11error[E0713]: borrow may still be in use when destructor runs
e74abb32 12 --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:16:13
0bf4aa26
XL
13 |
14LL | fn finish_2(s: S) -> &mut String {
15 | - has type `S<'1>`
16LL | let p = &mut *s.url; p
17 | ^^^^^^^^^^^ - returning this value requires that `*s.url` is borrowed for `'1`
18LL | }
19 | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
20
21error[E0713]: borrow may still be in use when destructor runs
e74abb32 22 --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:21:21
0bf4aa26
XL
23 |
24LL | fn finish_3(s: S) -> &mut String {
25 | - has type `S<'1>`
26LL | let p: &mut _ = s.url; p
27 | ^^^^^ - returning this value requires that `*s.url` is borrowed for `'1`
28LL | }
29 | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait
30
31error[E0509]: cannot move out of type `S<'_>`, which implements the `Drop` trait
e74abb32 32 --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:26:13
0bf4aa26
XL
33 |
34LL | let p = s.url; p
35 | ^^^^^
36 | |
37 | cannot move out of here
1b1a35ee 38 | move occurs because `s.url` has type `&mut String`, which does not implement the `Copy` trait
0bf4aa26
XL
39 | help: consider borrowing here: `&s.url`
40
41error: aborting due to 4 previous errors
42
48663c56 43Some errors have detailed explanations: E0509, E0713.
0bf4aa26 44For more information about an error, try `rustc --explain E0509`.