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