fork/rust

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

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

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