2018-09-17 18:52:31 -05:00
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2019-09-06 09:02:04 -05:00
|
|
|
--> $DIR/issue-31567.rs:10:26
|
2018-02-27 15:14:41 -06:00
|
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 {
|
|
|
|
| -- lifetime `'a` defined here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let s_inner: &'a S = &*v.0;
|
2018-10-14 09:12:02 -05:00
|
|
|
| ----- ^^^^^
|
|
|
|
| |
|
|
|
|
| type annotation requires that `*v.0` is borrowed for `'a`
|
2018-02-27 15:14:41 -06:00
|
|
|
LL | &s_inner.0
|
|
|
|
LL | }
|
2018-09-17 18:52:31 -05:00
|
|
|
| - here, drop of `v` needs exclusive access to `*v.0`, because the type `VecWrapper<'_>` implements the `Drop` trait
|
2018-02-27 15:14:41 -06:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2018-09-17 18:52:31 -05:00
|
|
|
For more information about this error, try `rustc --explain E0713`.
|