Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polonius: more ui test suite fixes #64554

Merged
merged 5 commits into from
Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error[E0597]: `x` does not live long enough
--> $DIR/async-borrowck-escaping-closure-error.rs:5:24
|
LL | Box::new((async || x)())
| -------------------^----
| | | |
| | | borrowed value does not live long enough
| | value captured here
| borrow later used here
LL |
LL | }
| - `x` dropped here while still borrowed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error[E0716]: temporary value dropped while borrowed
--> $DIR/return-local-binding-from-desugaring.rs:26:18
|
LL | for ref x in xs {
| ^^ creates a temporary which is freed while still in use
...
LL | }
| - temporary value is freed at the end of this statement
LL | result
| ------ borrow later used here
|
= note: consider using a `let` binding to create a longer lived value

error: aborting due to previous error

For more information about this error, try `rustc --explain E0716`.
12 changes: 8 additions & 4 deletions src/test/ui/dropck/dropck_trait_cycle_checked.polonius.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ LL | }
| -
| |
| `o2` dropped here while still borrowed
| borrow might be used here, when `o2` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
| borrow might be used here, when `o1` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
|
= note: values in a scope are dropped in the opposite order they are defined

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

error[E0597]: `o2` does not live long enough
--> $DIR/dropck_trait_cycle_checked.rs:113:13
Expand All @@ -38,7 +42,7 @@ error[E0597]: `o3` does not live long enough
--> $DIR/dropck_trait_cycle_checked.rs:114:13
|
LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
| -------- cast requires that `o3` is borrowed for `'static`
| -------- cast requires that `o3` is borrowed for `'static`
...
LL | o2.set1(&o3);
| ^^^ borrowed value does not live long enough
Expand All @@ -62,7 +66,7 @@ error[E0597]: `o2` does not live long enough
--> $DIR/dropck_trait_cycle_checked.rs:116:13
|
LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
| -------- cast requires that `o2` is borrowed for `'static`
| -------- cast requires that `o2` is borrowed for `'static`
...
LL | o3.set1(&o2);
| ^^^ borrowed value does not live long enough
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/json-multiple.polonius.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"artifact":"$TEST_BUILD_DIR/json-multiple.polonius/libjson_multiple.rlib","emit":"link"}
1 change: 1 addition & 0 deletions src/test/ui/json-options.polonius.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"artifact":"$TEST_BUILD_DIR/json-options.polonius/libjson_options.rlib","emit":"link"}