Skip to content

Commit 0835100

Browse files
authored
Rollup merge of rust-lang#64554 - lqd:polonius_tests4, r=nikomatsakis
Polonius: more `ui` test suite fixes Since rust-lang#62736, new tests have been added, and the `run-pass` suite was merged into the `ui` suite. This PR adds the missing tests expectations for Polonius, and updates the existing ones where the NLL output has changed in some manner (e.g. ordering of notes) Those are the trivial cases, but a more-detailed explanation is available [in this write-up](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?both#26-async-awaitasync-borrowck-escaping-closure-errorrs-outputs-from-NLL-Polonius-diff) starting at test case 26: they are only differing in diagnostics and instances of other existing test cases differences. Only 3 of the 9020 tests are still "failing" at the moment (1 failure, 2 OOMs). r? @nikomatsakis
2 parents 11a0b96 + f9c7329 commit 0835100

5 files changed

+42
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0597]: `x` does not live long enough
2+
--> $DIR/async-borrowck-escaping-closure-error.rs:5:24
3+
|
4+
LL | Box::new((async || x)())
5+
| -------------------^----
6+
| | | |
7+
| | | borrowed value does not live long enough
8+
| | value captured here
9+
| borrow later used here
10+
LL |
11+
LL | }
12+
| - `x` dropped here while still borrowed
13+
14+
error: aborting due to previous error
15+
16+
For more information about this error, try `rustc --explain E0597`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0716]: temporary value dropped while borrowed
2+
--> $DIR/return-local-binding-from-desugaring.rs:26:18
3+
|
4+
LL | for ref x in xs {
5+
| ^^ creates a temporary which is freed while still in use
6+
...
7+
LL | }
8+
| - temporary value is freed at the end of this statement
9+
LL | result
10+
| ------ borrow later used here
11+
|
12+
= note: consider using a `let` binding to create a longer lived value
13+
14+
error: aborting due to previous error
15+
16+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/dropck/dropck_trait_cycle_checked.polonius.stderr

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ LL | }
88
| -
99
| |
1010
| `o2` dropped here while still borrowed
11-
| borrow might be used here, when `o2` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
11+
| borrow might be used here, when `o1` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
12+
|
13+
= note: values in a scope are dropped in the opposite order they are defined
1214

1315
error[E0597]: `o3` does not live long enough
1416
--> $DIR/dropck_trait_cycle_checked.rs:112:13
@@ -20,7 +22,9 @@ LL | }
2022
| -
2123
| |
2224
| `o3` dropped here while still borrowed
23-
| borrow might be used here, when `o3` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
25+
| borrow might be used here, when `o1` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
26+
|
27+
= note: values in a scope are dropped in the opposite order they are defined
2428

2529
error[E0597]: `o2` does not live long enough
2630
--> $DIR/dropck_trait_cycle_checked.rs:113:13
@@ -38,7 +42,7 @@ error[E0597]: `o3` does not live long enough
3842
--> $DIR/dropck_trait_cycle_checked.rs:114:13
3943
|
4044
LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
41-
| -------- cast requires that `o3` is borrowed for `'static`
45+
| -------- cast requires that `o3` is borrowed for `'static`
4246
...
4347
LL | o2.set1(&o3);
4448
| ^^^ borrowed value does not live long enough
@@ -62,7 +66,7 @@ error[E0597]: `o2` does not live long enough
6266
--> $DIR/dropck_trait_cycle_checked.rs:116:13
6367
|
6468
LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
65-
| -------- cast requires that `o2` is borrowed for `'static`
69+
| -------- cast requires that `o2` is borrowed for `'static`
6670
...
6771
LL | o3.set1(&o2);
6872
| ^^^ borrowed value does not live long enough
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"artifact":"$TEST_BUILD_DIR/json-multiple.polonius/libjson_multiple.rlib","emit":"link"}
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"artifact":"$TEST_BUILD_DIR/json-options.polonius/libjson_options.rlib","emit":"link"}

0 commit comments

Comments
 (0)