2018-09-17 18:52:31 -05:00
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-31567.rs:12: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
|
2018-09-17 18:52:31 -05:00
|
|
|
LL | let s_inner: &'a S = &*v.0; //~ ERROR borrow may still be in use when destructor runs [E0713]
|
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`.
|