diff --git a/src/test/ui/dropck/dropck-eyepatch-extern-crate.nll.stderr b/src/test/ui/dropck/dropck-eyepatch-extern-crate.nll.stderr index b59f628c746b..e0b7fc4eb905 100644 --- a/src/test/ui/dropck/dropck-eyepatch-extern-crate.nll.stderr +++ b/src/test/ui/dropck/dropck-eyepatch-extern-crate.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `c_shortest` dropped here while still borrowed - | borrow later used here, when `dt` is dropped + | borrow might be used here, when `dt` is dropped and runs the `Drop` code for type `other::Dt` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/dropck/dropck-eyepatch-reorder.nll.stderr b/src/test/ui/dropck/dropck-eyepatch-reorder.nll.stderr index ad460fcf55e5..97c1caa87f5c 100644 --- a/src/test/ui/dropck/dropck-eyepatch-reorder.nll.stderr +++ b/src/test/ui/dropck/dropck-eyepatch-reorder.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `c_shortest` dropped here while still borrowed - | borrow later used here, when `dt` is dropped + | borrow might be used here, when `dt` is dropped and runs the `Drop` code for type `Dt` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/dropck/dropck-eyepatch.nll.stderr b/src/test/ui/dropck/dropck-eyepatch.nll.stderr index 864fb2f2ea6f..4a6e42ef94a8 100644 --- a/src/test/ui/dropck/dropck-eyepatch.nll.stderr +++ b/src/test/ui/dropck/dropck-eyepatch.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `c_shortest` dropped here while still borrowed - | borrow later used here, when `dt` is dropped + | borrow might be used here, when `dt` is dropped and runs the `Drop` code for type `Dt` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/dropck/dropck-union.nll.stderr b/src/test/ui/dropck/dropck-union.nll.stderr index ffb322b85dc3..b828a1675610 100644 --- a/src/test/ui/dropck/dropck-union.nll.stderr +++ b/src/test/ui/dropck/dropck-union.nll.stderr @@ -7,7 +7,7 @@ LL | } | - | | | `v` dropped here while still borrowed - | borrow later used here, when `v` is dropped + | borrow might be used here, when `v` is dropped and runs the `Drop` code for type `Wrap` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0597.nll.stderr b/src/test/ui/error-codes/E0597.nll.stderr index 31ba24b0004f..54a46f612b9e 100644 --- a/src/test/ui/error-codes/E0597.nll.stderr +++ b/src/test/ui/error-codes/E0597.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `y` dropped here while still borrowed - | borrow later used here, when `x` is dropped + | borrow might be used here, when `x` is dropped and runs the `Drop` code for type `Foo` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/generator/borrowing.nll.stderr b/src/test/ui/generator/borrowing.nll.stderr index 2488df7772b3..9d1a52a83354 100644 --- a/src/test/ui/generator/borrowing.nll.stderr +++ b/src/test/ui/generator/borrowing.nll.stderr @@ -2,10 +2,17 @@ error[E0597]: `a` does not live long enough --> $DIR/borrowing.rs:18:18 | LL | unsafe { (|| yield &a).resume() } - | ^^^^^^^^^^^^^ borrowed value does not live long enough + | ^^^^^^^^^^^^^ + | | + | borrowed value does not live long enough + | a temporary with access to the borrow is created here ... LL | //~^ ERROR: `a` does not live long enough LL | }; - | - `a` dropped here while still borrowed + | -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for generator + | | + | `a` dropped here while still borrowed + | + = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block. error[E0597]: `a` does not live long enough --> $DIR/borrowing.rs:24:9 diff --git a/src/test/ui/generator/dropck.nll.stderr b/src/test/ui/generator/dropck.nll.stderr index ef7e64ffd97a..2b95a5caf6da 100644 --- a/src/test/ui/generator/dropck.nll.stderr +++ b/src/test/ui/generator/dropck.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `*cell` dropped here while still borrowed - | borrow later used here, when `gen` is dropped + | borrow might be used here, when `gen` is dropped and runs the destructor for generator | = note: values in a scope are dropped in the opposite order they are defined @@ -27,7 +27,7 @@ LL | } | - | | | `ref_` dropped here while still borrowed - | borrow later used here, when `gen` is dropped + | borrow might be used here, when `gen` is dropped and runs the destructor for generator | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/issues/issue-18783.nll.stderr b/src/test/ui/issues/issue-18783.nll.stderr index 2531279f7508..023021eccb93 100644 --- a/src/test/ui/issues/issue-18783.nll.stderr +++ b/src/test/ui/issues/issue-18783.nll.stderr @@ -11,7 +11,7 @@ LL | c.push(Box::new(|| y = 0)); | second mutable borrow occurs here LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time LL | } - | - first borrow later used here, when `c` is dropped + | - first borrow might be used here, when `c` is dropped and runs the destructor for type `std::cell::RefCell>>` error[E0499]: cannot borrow `y` as mutable more than once at a time --> $DIR/issue-18783.rs:26:29 @@ -26,7 +26,7 @@ LL | Push::push(&c, Box::new(|| y = 0)); | second mutable borrow occurs here LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time LL | } - | - first borrow later used here, when `c` is dropped + | - first borrow might be used here, when `c` is dropped and runs the destructor for type `std::cell::RefCell>>` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-47646.stderr b/src/test/ui/issues/issue-47646.stderr index 4bdce85d18b5..116cb3be6b50 100644 --- a/src/test/ui/issues/issue-47646.stderr +++ b/src/test/ui/issues/issue-47646.stderr @@ -3,9 +3,15 @@ error[E0502]: cannot borrow `heap` as immutable because it is also borrowed as m | LL | let borrow = heap.peek_mut(); | ---- mutable borrow occurs here -... +LL | +LL | match (borrow, ()) { + | ------------ a temporary with access to the mutable borrow is created here ... +LL | (Some(_), ()) => { LL | println!("{:?}", heap); //~ ERROR cannot borrow `heap` as immutable | ^^^^ immutable borrow occurs here +... +LL | }; + | - ... and the mutable borrow might be used here, when that temporary is dropped and runs the destructor for type `(std::option::Option>, ())` error: aborting due to previous error diff --git a/src/test/ui/nll/drop-no-may-dangle.stderr b/src/test/ui/nll/drop-no-may-dangle.stderr index a35271bdcfef..60862d0f2295 100644 --- a/src/test/ui/nll/drop-no-may-dangle.stderr +++ b/src/test/ui/nll/drop-no-may-dangle.stderr @@ -8,7 +8,7 @@ LL | v[0] += 1; //~ ERROR cannot assign to `v[..]` because it is borrowe | ^^^^^^^^^ assignment to borrowed `v[..]` occurs here ... LL | } - | - borrow later used here, when `p` is dropped + | - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle` error[E0506]: cannot assign to `v[..]` because it is borrowed --> $DIR/drop-no-may-dangle.rs:33:5 @@ -19,7 +19,7 @@ LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] }; LL | v[0] += 1; //~ ERROR cannot assign to `v[..]` because it is borrowed | ^^^^^^^^^ assignment to borrowed `v[..]` occurs here LL | } - | - borrow later used here, when `p` is dropped + | - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle` error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr b/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr index 6fc26d502d30..fc5417ac80c4 100644 --- a/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr +++ b/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr @@ -8,7 +8,7 @@ LL | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506] | ^^^^^ assignment to borrowed `x` occurs here LL | // FIXME ^ Should not error in the future with implicit dtors, only manually implemented ones LL | } - | - borrow later used here, when `foo` is dropped + | - borrow might be used here, when `foo` is dropped and runs the destructor for type `Foo<'_>` error: aborting due to previous error diff --git a/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr b/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr index 54be12f28954..6ae026fb169b 100644 --- a/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr +++ b/src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr @@ -7,7 +7,7 @@ LL | let wrap = Wrap { p: &mut x }; LL | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506] | ^^^^^ assignment to borrowed `x` occurs here LL | } - | - borrow later used here, when `foo` is dropped + | - borrow might be used here, when `foo` is dropped and runs the destructor for type `Foo<'_>` error: aborting due to previous error diff --git a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr index ee926e427931..dd16e9a0e840 100644 --- a/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr +++ b/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr @@ -8,7 +8,7 @@ LL | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506] | ^^^^^ assignment to borrowed `x` occurs here LL | // FIXME ^ This currently errors and it should not. LL | } - | - borrow later used here, when `foo` is dropped + | - borrow might be used here, when `foo` is dropped and runs the destructor for type `Foo<'_>` error: aborting due to previous error diff --git a/src/test/ui/nll/maybe-initialized-drop.stderr b/src/test/ui/nll/maybe-initialized-drop.stderr index cc842c29ccb1..e8f427826ba3 100644 --- a/src/test/ui/nll/maybe-initialized-drop.stderr +++ b/src/test/ui/nll/maybe-initialized-drop.stderr @@ -6,7 +6,7 @@ LL | let wrap = Wrap { p: &mut x }; LL | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506] | ^^^^^ assignment to borrowed `x` occurs here LL | } - | - borrow later used here, when `wrap` is dropped + | - borrow might be used here, when `wrap` is dropped and runs the `Drop` code for type `Wrap` error: aborting due to previous error diff --git a/src/test/ui/span/destructor-restrictions.nll.stderr b/src/test/ui/span/destructor-restrictions.nll.stderr index 22f2f13f1f7c..99a839f76d33 100644 --- a/src/test/ui/span/destructor-restrictions.nll.stderr +++ b/src/test/ui/span/destructor-restrictions.nll.stderr @@ -2,9 +2,16 @@ error[E0597]: `*a` does not live long enough --> $DIR/destructor-restrictions.rs:18:10 | LL | *a.borrow() + 1 - | ^ borrowed value does not live long enough + | ^--------- + | | + | borrowed value does not live long enough + | a temporary with access to the borrow is created here ... LL | }; //~^ ERROR `*a` does not live long enough - | - `*a` dropped here while still borrowed + | -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::cell::Ref<'_, i32>` + | | + | `*a` dropped here while still borrowed + | + = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block. error: aborting due to previous error diff --git a/src/test/ui/span/dropck-object-cycle.nll.stderr b/src/test/ui/span/dropck-object-cycle.nll.stderr index 08e4b9ec9faa..52d4007f3f8f 100644 --- a/src/test/ui/span/dropck-object-cycle.nll.stderr +++ b/src/test/ui/span/dropck-object-cycle.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `*m` dropped here while still borrowed - | borrow later used here, when `m` is dropped + | borrow might be used here, when `m` is dropped and runs the destructor for type `std::boxed::Box>` error: aborting due to previous error diff --git a/src/test/ui/span/dropck_arr_cycle_checked.nll.stderr b/src/test/ui/span/dropck_arr_cycle_checked.nll.stderr index 74db695e7e56..32abfd81f53a 100644 --- a/src/test/ui/span/dropck_arr_cycle_checked.nll.stderr +++ b/src/test/ui/span/dropck_arr_cycle_checked.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `b2` dropped here while still borrowed - | borrow later used here, when `b1` is dropped + | borrow might be used here, when `b1` is dropped and runs the destructor for type `B<'_>` | = note: values in a scope are dropped in the opposite order they are defined @@ -22,7 +22,7 @@ LL | } | - | | | `b3` dropped here while still borrowed - | borrow later used here, when `b1` is dropped + | borrow might be used here, when `b1` is dropped and runs the destructor for type `B<'_>` | = note: values in a scope are dropped in the opposite order they are defined @@ -36,7 +36,7 @@ LL | } | - | | | `b1` dropped here while still borrowed - | borrow later used here, when `b1` is dropped + | borrow might be used here, when `b1` is dropped and runs the destructor for type `B<'_>` error: aborting due to 3 previous errors diff --git a/src/test/ui/span/dropck_direct_cycle_with_drop.nll.stderr b/src/test/ui/span/dropck_direct_cycle_with_drop.nll.stderr index baf3cef2ae83..0c5c49c80de5 100644 --- a/src/test/ui/span/dropck_direct_cycle_with_drop.nll.stderr +++ b/src/test/ui/span/dropck_direct_cycle_with_drop.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `d2` dropped here while still borrowed - | borrow later used here, when `d1` is dropped + | borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D` | = note: values in a scope are dropped in the opposite order they are defined @@ -22,7 +22,7 @@ LL | } | - | | | `d1` dropped here while still borrowed - | borrow later used here, when `d1` is dropped + | borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D` error: aborting due to 2 previous errors diff --git a/src/test/ui/span/dropck_misc_variants.nll.stderr b/src/test/ui/span/dropck_misc_variants.nll.stderr index 27a52360bb70..fb68262b0ae2 100644 --- a/src/test/ui/span/dropck_misc_variants.nll.stderr +++ b/src/test/ui/span/dropck_misc_variants.nll.stderr @@ -7,7 +7,7 @@ LL | } | - | | | `bomb` dropped here while still borrowed - | borrow later used here, when `_w` is dropped + | borrow might be used here, when `_w` is dropped and runs the destructor for type `Wrap<&[&str]>` | = note: values in a scope are dropped in the opposite order they are defined @@ -21,7 +21,7 @@ LL | } | - | | | `v` dropped here while still borrowed - | borrow later used here, when `_w` is dropped + | borrow might be used here, when `_w` is dropped and runs the destructor for closure | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr b/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr index f7ff4e5169fd..ad62936b870c 100644 --- a/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr +++ b/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `c2` dropped here while still borrowed - | borrow later used here, when `c1` is dropped + | borrow might be used here, when `c1` is dropped and runs the destructor for type `C<'_>` | = note: values in a scope are dropped in the opposite order they are defined @@ -22,7 +22,7 @@ LL | } | - | | | `c3` dropped here while still borrowed - | borrow later used here, when `c1` is dropped + | borrow might be used here, when `c1` is dropped and runs the destructor for type `C<'_>` | = note: values in a scope are dropped in the opposite order they are defined @@ -36,7 +36,7 @@ LL | } | - | | | `c1` dropped here while still borrowed - | borrow later used here, when `c1` is dropped + | borrow might be used here, when `c1` is dropped and runs the destructor for type `C<'_>` error: aborting due to 3 previous errors diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr index fe0187f38637..9e82884b9544 100644 --- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr +++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr @@ -2,17 +2,32 @@ error[E0597]: `y` does not live long enough --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:20:5 | LL | y.borrow().clone() - | ^ borrowed value does not live long enough + | ^--------- + | | + | borrowed value does not live long enough + | a temporary with access to the borrow is created here ... LL | } - | - `y` dropped here while still borrowed + | - + | | + | `y` dropped here while still borrowed + | ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::cell::Ref<'_, std::string::String>` + | + = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block. error[E0597]: `y` does not live long enough --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:27:9 | LL | y.borrow().clone() - | ^ borrowed value does not live long enough + | ^--------- + | | + | borrowed value does not live long enough + | a temporary with access to the borrow is created here ... LL | }; - | - `y` dropped here while still borrowed + | -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::cell::Ref<'_, std::string::String>` + | | + | `y` dropped here while still borrowed + | + = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block. error: aborting due to 2 previous errors diff --git a/src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.nll.stderr b/src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.nll.stderr index b9834a3d4379..fb995990f167 100644 --- a/src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.nll.stderr +++ b/src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `d1` dropped here while still borrowed - | borrow later used here, when `_d` is dropped + | borrow might be used here, when `_d` is dropped and runs the `Drop` code for type `D_Child` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/issue-24805-dropck-trait-has-items.nll.stderr b/src/test/ui/span/issue-24805-dropck-trait-has-items.nll.stderr index cd3d658aa872..5eaff66e72ea 100644 --- a/src/test/ui/span/issue-24805-dropck-trait-has-items.nll.stderr +++ b/src/test/ui/span/issue-24805-dropck-trait-has-items.nll.stderr @@ -7,7 +7,7 @@ LL | } | - | | | `d1` dropped here while still borrowed - | borrow later used here, when `_d` is dropped + | borrow might be used here, when `_d` is dropped and runs the `Drop` code for type `D_HasSelfMethod` | = note: values in a scope are dropped in the opposite order they are defined @@ -20,7 +20,7 @@ LL | } | - | | | `d1` dropped here while still borrowed - | borrow later used here, when `_d` is dropped + | borrow might be used here, when `_d` is dropped and runs the `Drop` code for type `D_HasMethodWithSelfArg` | = note: values in a scope are dropped in the opposite order they are defined @@ -33,7 +33,7 @@ LL | } | - | | | `d1` dropped here while still borrowed - | borrow later used here, when `_d` is dropped + | borrow might be used here, when `_d` is dropped and runs the `Drop` code for type `D_HasType` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/issue-24895-copy-clone-dropck.nll.stderr b/src/test/ui/span/issue-24895-copy-clone-dropck.nll.stderr index 54c6ac43f347..26c74b653a11 100644 --- a/src/test/ui/span/issue-24895-copy-clone-dropck.nll.stderr +++ b/src/test/ui/span/issue-24895-copy-clone-dropck.nll.stderr @@ -7,7 +7,7 @@ LL | } | - | | | `d1` dropped here while still borrowed - | borrow later used here, when `d2` is dropped + | borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/issue-25199.nll.stderr b/src/test/ui/span/issue-25199.nll.stderr index a81b591d288e..9801f92ce644 100644 --- a/src/test/ui/span/issue-25199.nll.stderr +++ b/src/test/ui/span/issue-25199.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `container` dropped here while still borrowed - | borrow later used here, when `container` is dropped + | borrow might be used here, when `container` is dropped and runs the destructor for type `Container<'_>` error: aborting due to previous error diff --git a/src/test/ui/span/issue-26656.nll.stderr b/src/test/ui/span/issue-26656.nll.stderr index b6c288281208..79d9dab17769 100644 --- a/src/test/ui/span/issue-26656.nll.stderr +++ b/src/test/ui/span/issue-26656.nll.stderr @@ -7,7 +7,7 @@ LL | } | - | | | `ticking` dropped here while still borrowed - | borrow later used here, when `zook` is dropped + | borrow might be used here, when `zook` is dropped and runs the `Drop` code for type `Zook` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/issue-29106.nll.stderr b/src/test/ui/span/issue-29106.nll.stderr index a1451866e677..77bb311c61a4 100644 --- a/src/test/ui/span/issue-29106.nll.stderr +++ b/src/test/ui/span/issue-29106.nll.stderr @@ -7,7 +7,7 @@ LL | } | - | | | `x` dropped here while still borrowed - | borrow later used here, when `y` is dropped + | borrow might be used here, when `y` is dropped and runs the `Drop` code for type `std::sync::Arc` | = note: values in a scope are dropped in the opposite order they are defined @@ -20,7 +20,7 @@ LL | } | - | | | `x` dropped here while still borrowed - | borrow later used here, when `y` is dropped + | borrow might be used here, when `y` is dropped and runs the `Drop` code for type `std::rc::Rc` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/issue28498-reject-ex1.nll.stderr b/src/test/ui/span/issue28498-reject-ex1.nll.stderr index 0f6f6e381d80..bc3a31b843fb 100644 --- a/src/test/ui/span/issue28498-reject-ex1.nll.stderr +++ b/src/test/ui/span/issue28498-reject-ex1.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | here, drop of `foo` needs exclusive access to `foo.data`, because the type `Foo>` implements the `Drop` trait - | borrow later used here, when `foo` is dropped + | borrow might be used here, when `foo` is dropped and runs the `Drop` code for type `Foo` | = note: consider using a `let` binding to create a longer lived value diff --git a/src/test/ui/span/issue28498-reject-lifetime-param.nll.stderr b/src/test/ui/span/issue28498-reject-lifetime-param.nll.stderr index 72acc54bffb3..21508303afc2 100644 --- a/src/test/ui/span/issue28498-reject-lifetime-param.nll.stderr +++ b/src/test/ui/span/issue28498-reject-lifetime-param.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `first_dropped` dropped here while still borrowed - | borrow later used here, when `foo1` is dropped + | borrow might be used here, when `foo1` is dropped and runs the `Drop` code for type `Foo` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/issue28498-reject-passed-to-fn.nll.stderr b/src/test/ui/span/issue28498-reject-passed-to-fn.nll.stderr index a39050a51991..752f96988db0 100644 --- a/src/test/ui/span/issue28498-reject-passed-to-fn.nll.stderr +++ b/src/test/ui/span/issue28498-reject-passed-to-fn.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `first_dropped` dropped here while still borrowed - | borrow later used here, when `foo1` is dropped + | borrow might be used here, when `foo1` is dropped and runs the `Drop` code for type `Foo` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/issue28498-reject-trait-bound.nll.stderr b/src/test/ui/span/issue28498-reject-trait-bound.nll.stderr index fcffea25702b..7bf55c8e9973 100644 --- a/src/test/ui/span/issue28498-reject-trait-bound.nll.stderr +++ b/src/test/ui/span/issue28498-reject-trait-bound.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `first_dropped` dropped here while still borrowed - | borrow later used here, when `foo1` is dropped + | borrow might be used here, when `foo1` is dropped and runs the `Drop` code for type `Foo` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.nll.stderr b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.nll.stderr index 6f7fbdcf4214..fd789e79e913 100644 --- a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.nll.stderr +++ b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.nll.stderr @@ -7,7 +7,7 @@ LL | let ss: &isize = &id(1); LL | } | - temporary value is freed at the end of this statement LL | } - | - borrow later used here, when `blah` is dropped + | - borrow might be used here, when `blah` is dropped and runs the destructor for type `std::boxed::Box` | = note: consider using a `let` binding to create a longer lived value diff --git a/src/test/ui/span/send-is-not-static-std-sync.nll.stderr b/src/test/ui/span/send-is-not-static-std-sync.nll.stderr index 878ae3638637..c17f502b7790 100644 --- a/src/test/ui/span/send-is-not-static-std-sync.nll.stderr +++ b/src/test/ui/span/send-is-not-static-std-sync.nll.stderr @@ -62,7 +62,7 @@ LL | } | - `z` dropped here while still borrowed ... LL | } - | - borrow later used here, when `tx` is dropped + | - borrow might be used here, when `tx` is dropped and runs the `Drop` code for type `std::sync::mpsc::Sender` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/span/vec-must-not-hide-type-from-dropck.nll.stderr b/src/test/ui/span/vec-must-not-hide-type-from-dropck.nll.stderr index 292c007f5122..7ad7a1b0bcdb 100644 --- a/src/test/ui/span/vec-must-not-hide-type-from-dropck.nll.stderr +++ b/src/test/ui/span/vec-must-not-hide-type-from-dropck.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `c2` dropped here while still borrowed - | borrow later used here, when `c1` is dropped + | borrow might be used here, when `c1` is dropped and runs the destructor for type `C<'_>` | = note: values in a scope are dropped in the opposite order they are defined @@ -22,7 +22,7 @@ LL | } | - | | | `c1` dropped here while still borrowed - | borrow later used here, when `c1` is dropped + | borrow might be used here, when `c1` is dropped and runs the destructor for type `C<'_>` error: aborting due to 2 previous errors diff --git a/src/test/ui/span/vec_refs_data_with_early_death.nll.stderr b/src/test/ui/span/vec_refs_data_with_early_death.nll.stderr index 60905367063a..562544c79165 100644 --- a/src/test/ui/span/vec_refs_data_with_early_death.nll.stderr +++ b/src/test/ui/span/vec_refs_data_with_early_death.nll.stderr @@ -8,7 +8,7 @@ LL | } | - | | | `x` dropped here while still borrowed - | borrow later used here, when `v` is dropped + | borrow might be used here, when `v` is dropped and runs the `Drop` code for type `Bag` | = note: values in a scope are dropped in the opposite order they are defined @@ -22,7 +22,7 @@ LL | } | - | | | `y` dropped here while still borrowed - | borrow later used here, when `v` is dropped + | borrow might be used here, when `v` is dropped and runs the `Drop` code for type `Bag` | = note: values in a scope are dropped in the opposite order they are defined diff --git a/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.nll.stderr index afd90237d16a..ad01f84cd2c1 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.nll.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.nll.stderr @@ -10,7 +10,7 @@ LL | } | - | | | `factorial` dropped here while still borrowed - | borrow later used here, when `factorial` is dropped + | borrow might be used here, when `factorial` is dropped and runs the destructor for type `std::option::Option u32>>` error[E0506]: cannot assign to `factorial` because it is borrowed --> $DIR/unboxed-closures-failed-recursive-fn-1.rs:30:5