fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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