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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 9 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 7 additions & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

0 commit comments

Comments
 (0)