fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
640 B16 linesraw
1error[E0713]: borrow may still be in use when destructor runs
2  --> $DIR/issue-31567.rs:10:26
3   |
4LL | fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 {
5   |                 -- lifetime `'a` defined here
6LL |     let s_inner: &'a S = &*v.0;
7   |                  -----   ^^^^^
8   |                  |
9   |                  type annotation requires that `*v.0` is borrowed for `'a`
10LL |     &s_inner.0
11LL | }
12   | - here, drop of `v` needs exclusive access to `*v.0`, because the type `VecWrapper<'_>` implements the `Drop` trait
13
14error: aborting due to previous error
15
16For more information about this error, try `rustc --explain E0713`.