From 222e9201511bb9a6eaca7fc2c0ee0b85d78c4fd7 Mon Sep 17 00:00:00 2001 From: lqd Date: Tue, 17 Sep 2019 19:30:34 +0200 Subject: [PATCH] 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 00000000000..c818379762c --- /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`.