]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/enum-drop-access.stderr
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / nll / enum-drop-access.stderr
1 error[E0713]: borrow may still be in use when destructor runs
2   --> $DIR/enum-drop-access.rs:13:31
3    |
4 LL | fn drop_enum(opt: DropOption<&mut i32>) -> Option<&mut i32> {
5    |                              - let's call the lifetime of this reference `'1`
6 LL |     match opt {
7 LL |         DropOption::Some(&mut ref mut r) => {
8    |                               ^^^^^^^^^
9 LL |             Some(r)
10    |             ------- returning this value requires that `*opt.0` is borrowed for `'1`
11 ...
12 LL | }
13    | - here, drop of `opt` needs exclusive access to `*opt.0`, because the type `DropOption<&mut i32>` implements the `Drop` trait
14
15 error[E0713]: borrow may still be in use when destructor runs
16   --> $DIR/enum-drop-access.rs:22:36
17    |
18 LL | fn optional_drop_enum(opt: Option<DropOption<&mut i32>>) -> Option<&mut i32> {
19    |                                              - let's call the lifetime of this reference `'1`
20 LL |     match opt {
21 LL |         Some(DropOption::Some(&mut ref mut r)) => {
22    |                                    ^^^^^^^^^
23 LL |             Some(r)
24    |             ------- returning this value requires that `*opt.0.0` is borrowed for `'1`
25 ...
26 LL | }
27    | - here, drop of `opt` needs exclusive access to `*opt.0.0`, because the type `DropOption<&mut i32>` implements the `Drop` trait
28
29 error: aborting due to 2 previous errors
30
31 For more information about this error, try `rustc --explain E0713`.