]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr
Auto merge of #53996 - sekineh:thumb-run, r=japaric
[rust.git] / src / test / ui / issues / issue-45696-scribble-on-boxed-borrow.nll.stderr
1 error[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 error[E0713]: borrow may still be in use when destructor runs
13   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:73:5
14    |
15 LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
16    |                    -- lifetime `'a` defined here
17 LL |     &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
18    |     ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
19 ...
20 LL | }
21    | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
22
23 error[E0713]: borrow may still be in use when destructor runs
24   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:83:5
25    |
26 LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
27    |                          -- lifetime `'a` defined here
28 LL |     &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
29    |     ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
30 ...
31 LL | }
32    | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
33
34 error: aborting due to 3 previous errors
35
36 For more information about this error, try `rustc --explain E0713`.