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