2018-09-23 10:07:45 -05:00
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2019-09-06 09:23:00 -05:00
|
|
|
--> $DIR/enum-drop-access.rs:13:31
|
2018-09-23 10:07:45 -05:00
|
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | fn drop_enum(opt: DropOption<&mut i32>) -> Option<&mut i32> {
|
|
|
|
| - let's call the lifetime of this reference `'1`
|
|
|
|
LL | match opt {
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | DropOption::Some(&mut ref mut r) => {
|
2018-09-23 10:07:45 -05:00
|
|
|
| ^^^^^^^^^
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | Some(r)
|
|
|
|
| ------- returning this value requires that `*opt.0` is borrowed for `'1`
|
2018-09-23 10:07:45 -05:00
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - here, drop of `opt` needs exclusive access to `*opt.0`, because the type `DropOption<&mut i32>` implements the `Drop` trait
|
|
|
|
|
|
|
|
error[E0713]: borrow may still be in use when destructor runs
|
2019-09-06 09:23:00 -05:00
|
|
|
--> $DIR/enum-drop-access.rs:22:36
|
2018-09-23 10:07:45 -05:00
|
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | fn optional_drop_enum(opt: Option<DropOption<&mut i32>>) -> Option<&mut i32> {
|
|
|
|
| - let's call the lifetime of this reference `'1`
|
|
|
|
LL | match opt {
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | Some(DropOption::Some(&mut ref mut r)) => {
|
2018-09-23 10:07:45 -05:00
|
|
|
| ^^^^^^^^^
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | Some(r)
|
|
|
|
| ------- returning this value requires that `*opt.0.0` is borrowed for `'1`
|
2018-09-23 10:07:45 -05:00
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - here, drop of `opt` needs exclusive access to `*opt.0.0`, because the type `DropOption<&mut i32>` implements the `Drop` trait
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0713`.
|