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