From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/nll/enum-drop-access.stderr | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/ui/nll/enum-drop-access.stderr (limited to 'src/test/ui/nll/enum-drop-access.stderr') diff --git a/src/test/ui/nll/enum-drop-access.stderr b/src/test/ui/nll/enum-drop-access.stderr new file mode 100644 index 000000000..a532ae121 --- /dev/null +++ b/src/test/ui/nll/enum-drop-access.stderr @@ -0,0 +1,31 @@ +error[E0713]: borrow may still be in use when destructor runs + --> $DIR/enum-drop-access.rs:13:31 + | +LL | fn drop_enum(opt: DropOption<&mut i32>) -> Option<&mut i32> { + | - let's call the lifetime of this reference `'1` +LL | match opt { +LL | DropOption::Some(&mut ref mut r) => { + | ^^^^^^^^^ +LL | Some(r) + | ------- returning this value requires that `*opt.0` is borrowed for `'1` +... +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 + --> $DIR/enum-drop-access.rs:22:36 + | +LL | fn optional_drop_enum(opt: Option>) -> Option<&mut i32> { + | - let's call the lifetime of this reference `'1` +LL | match opt { +LL | Some(DropOption::Some(&mut ref mut r)) => { + | ^^^^^^^^^ +LL | Some(r) + | ------- returning this value requires that `*opt.0.0` is borrowed for `'1` +... +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`. -- cgit v1.2.3