fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.5 KiB36 linesraw
1error[E0713]: borrow may still be in use when destructor runs
2  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:52:5
3   |
4LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
5   |              -- lifetime `'a` defined here
6LL |     &mut *s.0
7   |     ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
8...
9LL | }
10   | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
11
12error[E0713]: borrow may still be in use when destructor runs
13  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5
14   |
15LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
16   |                    -- lifetime `'a` defined here
17LL |     &mut *(*s).0
18   |     ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
19...
20LL | }
21   | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
22
23error[E0713]: borrow may still be in use when destructor runs
24  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:74:5
25   |
26LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
27   |                          -- lifetime `'a` defined here
28LL |     &mut *(**s).0
29   |     ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
30...
31LL | }
32   | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
33
34error: aborting due to 3 previous errors
35
36For more information about this error, try `rustc --explain E0713`.