2019-09-06 08:47:50 -05:00
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2019-09-25 15:09:09 -05:00
|
|
|
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:35:5
|
2019-09-06 08:47:50 -05:00
|
|
|
|
|
|
|
|
LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
LL | &mut *s.0
|
|
|
|
| ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
|
|
|
|
LL | }
|
|
|
|
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
|
|
|
|
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2019-09-25 15:09:09 -05:00
|
|
|
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:40:5
|
2019-09-06 08:47:50 -05:00
|
|
|
|
|
|
|
|
LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
LL | &mut *(*s).0
|
|
|
|
| ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
|
|
|
|
LL | }
|
|
|
|
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
|
|
|
|
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2019-09-25 15:09:09 -05:00
|
|
|
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:45:5
|
2019-09-06 08:47:50 -05:00
|
|
|
|
|
|
|
|
LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
LL | &mut *(**s).0
|
|
|
|
| ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
|
|
|
|
LL | }
|
|
|
|
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0713`.
|