]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-45696-scribble-on-boxed-borrow.migrate.stderr
1 warning[E0713]: borrow may still be in use when destructor runs
2   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5
3    |
4 LL |     &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
5    |     ^^^^^^^^^
6 ...
7 LL | }
8    | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
9    |
10 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 62:14...
11   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:62:14
12    |
13 LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
14    |              ^^
15    = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
16            It represents potential unsoundness in your code.
17            This warning will become a hard error in the future.
18
19 warning[E0713]: borrow may still be in use when destructor runs
20   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:73:5
21    |
22 LL |     &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
23    |     ^^^^^^^^^^^^
24 ...
25 LL | }
26    | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
27    |
28 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 72:20...
29   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:72:20
30    |
31 LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
32    |                    ^^
33    = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
34            It represents potential unsoundness in your code.
35            This warning will become a hard error in the future.
36
37 warning[E0713]: borrow may still be in use when destructor runs
38   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:83:5
39    |
40 LL |     &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
41    |     ^^^^^^^^^^^^^
42 ...
43 LL | }
44    | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
45    |
46 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 82:26...
47   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:82:26
48    |
49 LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
50    |                          ^^
51    = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
52            It represents potential unsoundness in your code.
53            This warning will become a hard error in the future.
54
55 error: compilation successful
56   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:89:1
57    |
58 LL | / fn main() { //[ast]~ ERROR compilation successful
59 LL | |      //[migrate]~^ ERROR compilation successful
60 LL | |     let mut x = 1;
61 LL | |     {
62 ...  |
63 LL | |     *boxed_boxed_scribbled(Box::new(Box::new(Scribble(&mut x)))) += 10;
64 LL | | }
65    | |_^
66
67 error: aborting due to previous error
68
69 For more information about this error, try `rustc --explain E0713`.