Skip to content

Commit 37f1003

Browse files
committed
Updates to .stderr output in ui tests from earlier changes.
1 parent 80bc171 commit 37f1003

36 files changed

+90
-55
lines changed

src/test/ui/dropck/dropck-eyepatch-extern-crate.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `c_shortest` dropped here while still borrowed
11-
| borrow later used here, when `dt` is dropped
11+
| borrow might be used here, when `dt` is dropped and runs the `Drop` code for type `other::Dt`
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

src/test/ui/dropck/dropck-eyepatch-reorder.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `c_shortest` dropped here while still borrowed
11-
| borrow later used here, when `dt` is dropped
11+
| borrow might be used here, when `dt` is dropped and runs the `Drop` code for type `Dt`
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

src/test/ui/dropck/dropck-eyepatch.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `c_shortest` dropped here while still borrowed
11-
| borrow later used here, when `dt` is dropped
11+
| borrow might be used here, when `dt` is dropped and runs the `Drop` code for type `Dt`
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

src/test/ui/dropck/dropck-union.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | }
77
| -
88
| |
99
| `v` dropped here while still borrowed
10-
| borrow later used here, when `v` is dropped
10+
| borrow might be used here, when `v` is dropped and runs the `Drop` code for type `Wrap`
1111

1212
error: aborting due to previous error
1313

src/test/ui/error-codes/E0597.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `y` dropped here while still borrowed
11-
| borrow later used here, when `x` is dropped
11+
| borrow might be used here, when `x` is dropped and runs the `Drop` code for type `Foo`
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

src/test/ui/generator/borrowing.nll.stderr

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ error[E0597]: `a` does not live long enough
22
--> $DIR/borrowing.rs:18:18
33
|
44
LL | unsafe { (|| yield &a).resume() }
5-
| ^^^^^^^^^^^^^ borrowed value does not live long enough
5+
| ^^^^^^^^^^^^^
6+
| |
7+
| borrowed value does not live long enough
8+
| a temporary with access to the borrow is created here ...
69
LL | //~^ ERROR: `a` does not live long enough
710
LL | };
8-
| - `a` dropped here while still borrowed
11+
| -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for generator
12+
| |
13+
| `a` dropped here while still borrowed
14+
|
15+
= 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.
916

1017
error[E0597]: `a` does not live long enough
1118
--> $DIR/borrowing.rs:24:9

src/test/ui/generator/dropck.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `*cell` dropped here while still borrowed
11-
| borrow later used here, when `gen` is dropped
11+
| borrow might be used here, when `gen` is dropped and runs the destructor for generator
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

@@ -27,7 +27,7 @@ LL | }
2727
| -
2828
| |
2929
| `ref_` dropped here while still borrowed
30-
| borrow later used here, when `gen` is dropped
30+
| borrow might be used here, when `gen` is dropped and runs the destructor for generator
3131
|
3232
= note: values in a scope are dropped in the opposite order they are defined
3333

src/test/ui/issues/issue-18783.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | c.push(Box::new(|| y = 0));
1111
| second mutable borrow occurs here
1212
LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time
1313
LL | }
14-
| - first borrow later used here, when `c` is dropped
14+
| - first borrow might be used here, when `c` is dropped and runs the destructor for type `std::cell::RefCell<std::vec::Vec<std::boxed::Box<dyn std::ops::FnMut()>>>`
1515

1616
error[E0499]: cannot borrow `y` as mutable more than once at a time
1717
--> $DIR/issue-18783.rs:26:29
@@ -26,7 +26,7 @@ LL | Push::push(&c, Box::new(|| y = 0));
2626
| second mutable borrow occurs here
2727
LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time
2828
LL | }
29-
| - first borrow later used here, when `c` is dropped
29+
| - first borrow might be used here, when `c` is dropped and runs the destructor for type `std::cell::RefCell<std::vec::Vec<std::boxed::Box<dyn std::ops::FnMut()>>>`
3030

3131
error: aborting due to 2 previous errors
3232

src/test/ui/issues/issue-47646.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ error[E0502]: cannot borrow `heap` as immutable because it is also borrowed as m
33
|
44
LL | let borrow = heap.peek_mut();
55
| ---- mutable borrow occurs here
6-
...
6+
LL |
7+
LL | match (borrow, ()) {
8+
| ------------ a temporary with access to the mutable borrow is created here ...
9+
LL | (Some(_), ()) => {
710
LL | println!("{:?}", heap); //~ ERROR cannot borrow `heap` as immutable
811
| ^^^^ immutable borrow occurs here
12+
...
13+
LL | };
14+
| - ... and the mutable borrow might be used here, when that temporary is dropped and runs the destructor for type `(std::option::Option<std::collections::binary_heap::PeekMut<'_, i32>>, ())`
915

1016
error: aborting due to previous error
1117

src/test/ui/nll/drop-no-may-dangle.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | v[0] += 1; //~ ERROR cannot assign to `v[..]` because it is borrowe
88
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
99
...
1010
LL | }
11-
| - borrow later used here, when `p` is dropped
11+
| - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle`
1212

1313
error[E0506]: cannot assign to `v[..]` because it is borrowed
1414
--> $DIR/drop-no-may-dangle.rs:33:5
@@ -19,7 +19,7 @@ LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
1919
LL | v[0] += 1; //~ ERROR cannot assign to `v[..]` because it is borrowed
2020
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
2121
LL | }
22-
| - borrow later used here, when `p` is dropped
22+
| - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle`
2323

2424
error: aborting due to 2 previous errors
2525

src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506]
88
| ^^^^^ assignment to borrowed `x` occurs here
99
LL | // FIXME ^ Should not error in the future with implicit dtors, only manually implemented ones
1010
LL | }
11-
| - borrow later used here, when `foo` is dropped
11+
| - borrow might be used here, when `foo` is dropped and runs the destructor for type `Foo<'_>`
1212

1313
error: aborting due to previous error
1414

src/test/ui/nll/maybe-initialized-drop-with-fragment.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | let wrap = Wrap { p: &mut x };
77
LL | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506]
88
| ^^^^^ assignment to borrowed `x` occurs here
99
LL | }
10-
| - borrow later used here, when `foo` is dropped
10+
| - borrow might be used here, when `foo` is dropped and runs the destructor for type `Foo<'_>`
1111

1212
error: aborting due to previous error
1313

src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506]
88
| ^^^^^ assignment to borrowed `x` occurs here
99
LL | // FIXME ^ This currently errors and it should not.
1010
LL | }
11-
| - borrow later used here, when `foo` is dropped
11+
| - borrow might be used here, when `foo` is dropped and runs the destructor for type `Foo<'_>`
1212

1313
error: aborting due to previous error
1414

src/test/ui/nll/maybe-initialized-drop.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let wrap = Wrap { p: &mut x };
66
LL | x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506]
77
| ^^^^^ assignment to borrowed `x` occurs here
88
LL | }
9-
| - borrow later used here, when `wrap` is dropped
9+
| - borrow might be used here, when `wrap` is dropped and runs the `Drop` code for type `Wrap`
1010

1111
error: aborting due to previous error
1212

src/test/ui/span/destructor-restrictions.nll.stderr

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ error[E0597]: `*a` does not live long enough
22
--> $DIR/destructor-restrictions.rs:18:10
33
|
44
LL | *a.borrow() + 1
5-
| ^ borrowed value does not live long enough
5+
| ^---------
6+
| |
7+
| borrowed value does not live long enough
8+
| a temporary with access to the borrow is created here ...
69
LL | }; //~^ ERROR `*a` does not live long enough
7-
| - `*a` dropped here while still borrowed
10+
| -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::cell::Ref<'_, i32>`
11+
| |
12+
| `*a` dropped here while still borrowed
13+
|
14+
= 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.
815

916
error: aborting due to previous error
1017

src/test/ui/span/dropck-object-cycle.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `*m` dropped here while still borrowed
11-
| borrow later used here, when `m` is dropped
11+
| borrow might be used here, when `m` is dropped and runs the destructor for type `std::boxed::Box<dyn Trait<'_>>`
1212

1313
error: aborting due to previous error
1414

src/test/ui/span/dropck_arr_cycle_checked.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `b2` dropped here while still borrowed
11-
| borrow later used here, when `b1` is dropped
11+
| borrow might be used here, when `b1` is dropped and runs the destructor for type `B<'_>`
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

@@ -22,7 +22,7 @@ LL | }
2222
| -
2323
| |
2424
| `b3` dropped here while still borrowed
25-
| borrow later used here, when `b1` is dropped
25+
| borrow might be used here, when `b1` is dropped and runs the destructor for type `B<'_>`
2626
|
2727
= note: values in a scope are dropped in the opposite order they are defined
2828

@@ -36,7 +36,7 @@ LL | }
3636
| -
3737
| |
3838
| `b1` dropped here while still borrowed
39-
| borrow later used here, when `b1` is dropped
39+
| borrow might be used here, when `b1` is dropped and runs the destructor for type `B<'_>`
4040

4141
error: aborting due to 3 previous errors
4242

src/test/ui/span/dropck_direct_cycle_with_drop.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `d2` dropped here while still borrowed
11-
| borrow later used here, when `d1` is dropped
11+
| borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

@@ -22,7 +22,7 @@ LL | }
2222
| -
2323
| |
2424
| `d1` dropped here while still borrowed
25-
| borrow later used here, when `d1` is dropped
25+
| borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
2626

2727
error: aborting due to 2 previous errors
2828

src/test/ui/span/dropck_misc_variants.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | }
77
| -
88
| |
99
| `bomb` dropped here while still borrowed
10-
| borrow later used here, when `_w` is dropped
10+
| borrow might be used here, when `_w` is dropped and runs the destructor for type `Wrap<&[&str]>`
1111
|
1212
= note: values in a scope are dropped in the opposite order they are defined
1313

@@ -21,7 +21,7 @@ LL | }
2121
| -
2222
| |
2323
| `v` dropped here while still borrowed
24-
| borrow later used here, when `_w` is dropped
24+
| borrow might be used here, when `_w` is dropped and runs the destructor for closure
2525
|
2626
= note: values in a scope are dropped in the opposite order they are defined
2727

src/test/ui/span/dropck_vec_cycle_checked.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `c2` dropped here while still borrowed
11-
| borrow later used here, when `c1` is dropped
11+
| borrow might be used here, when `c1` is dropped and runs the destructor for type `C<'_>`
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

@@ -22,7 +22,7 @@ LL | }
2222
| -
2323
| |
2424
| `c3` dropped here while still borrowed
25-
| borrow later used here, when `c1` is dropped
25+
| borrow might be used here, when `c1` is dropped and runs the destructor for type `C<'_>`
2626
|
2727
= note: values in a scope are dropped in the opposite order they are defined
2828

@@ -36,7 +36,7 @@ LL | }
3636
| -
3737
| |
3838
| `c1` dropped here while still borrowed
39-
| borrow later used here, when `c1` is dropped
39+
| borrow might be used here, when `c1` is dropped and runs the destructor for type `C<'_>`
4040

4141
error: aborting due to 3 previous errors
4242

src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr

+19-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,32 @@ error[E0597]: `y` does not live long enough
22
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:20:5
33
|
44
LL | y.borrow().clone()
5-
| ^ borrowed value does not live long enough
5+
| ^---------
6+
| |
7+
| borrowed value does not live long enough
8+
| a temporary with access to the borrow is created here ...
69
LL | }
7-
| - `y` dropped here while still borrowed
10+
| -
11+
| |
12+
| `y` dropped here while still borrowed
13+
| ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::cell::Ref<'_, std::string::String>`
14+
|
15+
= 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.
816

917
error[E0597]: `y` does not live long enough
1018
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:27:9
1119
|
1220
LL | y.borrow().clone()
13-
| ^ borrowed value does not live long enough
21+
| ^---------
22+
| |
23+
| borrowed value does not live long enough
24+
| a temporary with access to the borrow is created here ...
1425
LL | };
15-
| - `y` dropped here while still borrowed
26+
| -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::cell::Ref<'_, std::string::String>`
27+
| |
28+
| `y` dropped here while still borrowed
29+
|
30+
= 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.
1631

1732
error: aborting due to 2 previous errors
1833

src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `d1` dropped here while still borrowed
11-
| borrow later used here, when `_d` is dropped
11+
| borrow might be used here, when `_d` is dropped and runs the `Drop` code for type `D_Child`
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

src/test/ui/span/issue-24805-dropck-trait-has-items.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | }
77
| -
88
| |
99
| `d1` dropped here while still borrowed
10-
| borrow later used here, when `_d` is dropped
10+
| borrow might be used here, when `_d` is dropped and runs the `Drop` code for type `D_HasSelfMethod`
1111
|
1212
= note: values in a scope are dropped in the opposite order they are defined
1313

@@ -20,7 +20,7 @@ LL | }
2020
| -
2121
| |
2222
| `d1` dropped here while still borrowed
23-
| borrow later used here, when `_d` is dropped
23+
| borrow might be used here, when `_d` is dropped and runs the `Drop` code for type `D_HasMethodWithSelfArg`
2424
|
2525
= note: values in a scope are dropped in the opposite order they are defined
2626

@@ -33,7 +33,7 @@ LL | }
3333
| -
3434
| |
3535
| `d1` dropped here while still borrowed
36-
| borrow later used here, when `_d` is dropped
36+
| borrow might be used here, when `_d` is dropped and runs the `Drop` code for type `D_HasType`
3737
|
3838
= note: values in a scope are dropped in the opposite order they are defined
3939

src/test/ui/span/issue-24895-copy-clone-dropck.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | }
77
| -
88
| |
99
| `d1` dropped here while still borrowed
10-
| borrow later used here, when `d2` is dropped
10+
| borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D`
1111
|
1212
= note: values in a scope are dropped in the opposite order they are defined
1313

src/test/ui/span/issue-25199.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | }
88
| -
99
| |
1010
| `container` dropped here while still borrowed
11-
| borrow later used here, when `container` is dropped
11+
| borrow might be used here, when `container` is dropped and runs the destructor for type `Container<'_>`
1212

1313
error: aborting due to previous error
1414

src/test/ui/span/issue-26656.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | }
77
| -
88
| |
99
| `ticking` dropped here while still borrowed
10-
| borrow later used here, when `zook` is dropped
10+
| borrow might be used here, when `zook` is dropped and runs the `Drop` code for type `Zook`
1111
|
1212
= note: values in a scope are dropped in the opposite order they are defined
1313

0 commit comments

Comments
 (0)