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