From 9f4351d406fe904a99a7588ebb1411e369ba71f7 Mon Sep 17 00:00:00 2001 From: lqd Date: Tue, 17 Sep 2019 19:28:49 +0200 Subject: [PATCH 1/5] Bless output of test borrowck/return-local-binding-from-desugaring.rs for Polonius --- ...rrowck-escaping-closure-error.polonius.stderr | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/ui/async-await/async-borrowck-escaping-closure-error.polonius.stderr diff --git a/src/test/ui/async-await/async-borrowck-escaping-closure-error.polonius.stderr b/src/test/ui/async-await/async-borrowck-escaping-closure-error.polonius.stderr new file mode 100644 index 0000000000000..5f20367b6aba9 --- /dev/null +++ b/src/test/ui/async-await/async-borrowck-escaping-closure-error.polonius.stderr @@ -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`. From 222e9201511bb9a6eaca7fc2c0ee0b85d78c4fd7 Mon Sep 17 00:00:00 2001 From: lqd Date: Tue, 17 Sep 2019 19:30:34 +0200 Subject: [PATCH 2/5] Bless output of test borrowck/return-local-binding-from-desugaring.rs for Polonius --- ...local-binding-from-desugaring.polonius.stderr | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/ui/borrowck/return-local-binding-from-desugaring.polonius.stderr diff --git a/src/test/ui/borrowck/return-local-binding-from-desugaring.polonius.stderr b/src/test/ui/borrowck/return-local-binding-from-desugaring.polonius.stderr new file mode 100644 index 0000000000000..c818379762c9d --- /dev/null +++ b/src/test/ui/borrowck/return-local-binding-from-desugaring.polonius.stderr @@ -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`. From 3ef980aeaae3ae92c1ed3bdbefe35c6175ed24fb Mon Sep 17 00:00:00 2001 From: lqd Date: Tue, 17 Sep 2019 19:32:36 +0200 Subject: [PATCH 3/5] Update expectations of test ui/dropck/dropck_trait_cycle_checked.rs for Polonius as its output was changed by https://github.com/rust-lang/rust/commit/2ff337a8e286a5b472f71b3bbdc3d4b6b840870f#diff-bd3f80b956148a5d1567aa8698b8a507 --- .../dropck_trait_cycle_checked.polonius.stderr | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/test/ui/dropck/dropck_trait_cycle_checked.polonius.stderr b/src/test/ui/dropck/dropck_trait_cycle_checked.polonius.stderr index dbcb0fcebb73d..5e93a0234259c 100644 --- a/src/test/ui/dropck/dropck_trait_cycle_checked.polonius.stderr +++ b/src/test/ui/dropck/dropck_trait_cycle_checked.polonius.stderr @@ -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>` + | borrow might be used here, when `o1` is dropped and runs the destructor for type `std::boxed::Box>` + | + = 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 @@ -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>` + | borrow might be used here, when `o1` is dropped and runs the destructor for type `std::boxed::Box>` + | + = 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 @@ -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, Box, Box) = (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 @@ -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, Box, Box) = (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 From 34d31673684a34b3858ba8dbc05fff8804a50508 Mon Sep 17 00:00:00 2001 From: lqd Date: Tue, 17 Sep 2019 19:34:12 +0200 Subject: [PATCH 4/5] Bless json output of test ui/json-multiple.rs for Polonius --- src/test/ui/json-multiple.polonius.stderr | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/test/ui/json-multiple.polonius.stderr diff --git a/src/test/ui/json-multiple.polonius.stderr b/src/test/ui/json-multiple.polonius.stderr new file mode 100644 index 0000000000000..0e4d442f299c3 --- /dev/null +++ b/src/test/ui/json-multiple.polonius.stderr @@ -0,0 +1 @@ +{"artifact":"$TEST_BUILD_DIR/json-multiple.polonius/libjson_multiple.rlib","emit":"link"} From f9c73293e231f1179c426311bd7ab11f46473e9a Mon Sep 17 00:00:00 2001 From: lqd Date: Tue, 17 Sep 2019 19:35:16 +0200 Subject: [PATCH 5/5] Bless json output of test ui/json-options.rs for Polonius --- src/test/ui/json-options.polonius.stderr | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/test/ui/json-options.polonius.stderr diff --git a/src/test/ui/json-options.polonius.stderr b/src/test/ui/json-options.polonius.stderr new file mode 100644 index 0000000000000..e21f6f85d162d --- /dev/null +++ b/src/test/ui/json-options.polonius.stderr @@ -0,0 +1 @@ +{"artifact":"$TEST_BUILD_DIR/json-options.polonius/libjson_options.rlib","emit":"link"}