Skip to content

Commit cfbd1a9

Browse files
committed
Update tests for changes to drop access
1 parent 4603fb8 commit cfbd1a9

8 files changed

+26
-10
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ LL | }
99
| |
1010
| `*cell` dropped here while still borrowed
1111
| borrow later used here, when `gen` is dropped
12+
|
13+
= note: values in a scope are dropped in the opposite order they are defined
1214

1315
error[E0597]: `ref_` does not live long enough
1416
--> $DIR/dropck.rs:22:11

src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LL | &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor
2323
| ^^^^^^^^^^^^
2424
...
2525
LL | }
26-
| - here, drop of `*s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
26+
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
2727
|
2828
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 72:20...
2929
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:72:20
@@ -41,7 +41,7 @@ LL | &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor
4141
| ^^^^^^^^^^^^^
4242
...
4343
LL | }
44-
| - here, drop of `**s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
44+
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
4545
|
4646
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 82:26...
4747
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:82:26

src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LL | &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor
2020
| ^^^^^^^^^^^^
2121
...
2222
LL | }
23-
| - here, drop of `*s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
23+
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
2424
|
2525
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 72:20...
2626
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:72:20
@@ -35,7 +35,7 @@ LL | &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor
3535
| ^^^^^^^^^^^^^
3636
...
3737
LL | }
38-
| - here, drop of `**s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
38+
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
3939
|
4040
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 82:26...
4141
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:82:26
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
error[E0713]: borrow may still be in use when destructor runs
2-
--> $DIR/borrowck-ref-into-rvalue.rs:14:14
1+
error[E0597]: borrowed value does not live long enough
2+
--> $DIR/borrowck-ref-into-rvalue.rs:13:11
33
|
4-
LL | Some(ref m) => {
5-
| ^^^^^
4+
LL | match Some("Hello".to_string()) {
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
66
...
77
LL | }
8-
| - drop of temporary value occurs here
8+
| - temporary value only lives until here
99
LL | println!("{}", *msg);
1010
| ---- borrow later used here
1111
|
1212
= note: consider using a `let` binding to create a longer lived value
1313

1414
error: aborting due to previous error
1515

16-
For more information about this error, try `rustc --explain E0713`.
16+
For more information about this error, try `rustc --explain E0597`.

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

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ LL | }
99
| |
1010
| `b2` dropped here while still borrowed
1111
| borrow later used here, when `b1` is dropped
12+
|
13+
= note: values in a scope are dropped in the opposite order they are defined
1214

1315
error[E0597]: `b3` does not live long enough
1416
--> $DIR/dropck_arr_cycle_checked.rs:105:24
@@ -21,6 +23,8 @@ LL | }
2123
| |
2224
| `b3` dropped here while still borrowed
2325
| borrow later used here, when `b1` is dropped
26+
|
27+
= note: values in a scope are dropped in the opposite order they are defined
2428

2529
error[E0597]: `b1` does not live long enough
2630
--> $DIR/dropck_arr_cycle_checked.rs:111:24

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

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ LL | }
99
| |
1010
| `c2` dropped here while still borrowed
1111
| borrow later used here, when `c1` is dropped
12+
|
13+
= note: values in a scope are dropped in the opposite order they are defined
1214

1315
error[E0597]: `c3` does not live long enough
1416
--> $DIR/dropck_vec_cycle_checked.rs:115:24
@@ -21,6 +23,8 @@ LL | }
2123
| |
2224
| `c3` dropped here while still borrowed
2325
| borrow later used here, when `c1` is dropped
26+
|
27+
= note: values in a scope are dropped in the opposite order they are defined
2428

2529
error[E0597]: `c1` does not live long enough
2630
--> $DIR/dropck_vec_cycle_checked.rs:121:24

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

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ LL | }
88
| |
99
| `x` dropped here while still borrowed
1010
| borrow later used here, when `y` is dropped
11+
|
12+
= note: values in a scope are dropped in the opposite order they are defined
1113

1214
error[E0597]: `x` does not live long enough
1315
--> $DIR/issue-29106.rs:33:25
@@ -19,6 +21,8 @@ LL | }
1921
| |
2022
| `x` dropped here while still borrowed
2123
| borrow later used here, when `y` is dropped
24+
|
25+
= note: values in a scope are dropped in the opposite order they are defined
2226

2327
error: aborting due to 2 previous errors
2428

src/test/ui/span/vec-must-not-hide-type-from-dropck.nll.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ LL | }
99
| |
1010
| `c2` dropped here while still borrowed
1111
| borrow later used here, when `c1` is dropped
12+
|
13+
= note: values in a scope are dropped in the opposite order they are defined
1214

1315
error[E0597]: `c1` does not live long enough
1416
--> $DIR/vec-must-not-hide-type-from-dropck.rs:129:24

0 commit comments

Comments
 (0)