issue-45696-scribble-on-boxed-borrow.nll.stderr 1.7 KB
Newer Older
1
error[E0713]: borrow may still be in use when destructor runs
F
Felix S. Klock II 已提交
2 3
  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5
   |
4 5
LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
   |              -- 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`
F
Felix S. Klock II 已提交
8 9
...
LL | }
10
   | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
F
Felix S. Klock II 已提交
11

12
error[E0713]: borrow may still be in use when destructor runs
F
Felix S. Klock II 已提交
13 14
  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:73:5
   |
15 16
LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
   |                    -- 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`
F
Felix S. Klock II 已提交
19 20
...
LL | }
21
   | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
F
Felix S. Klock II 已提交
22

23
error[E0713]: borrow may still be in use when destructor runs
F
Felix S. Klock II 已提交
24 25
  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:83:5
   |
26 27
LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
   |                          -- 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`
F
Felix S. Klock II 已提交
30 31
...
LL | }
32
   | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
F
Felix S. Klock II 已提交
33 34 35

error: aborting due to 3 previous errors

36
For more information about this error, try `rustc --explain E0713`.