about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlqd <remy.rakic+github@gmail.com>2019-09-17 19:30:34 +0200
committerlqd <remy.rakic+github@gmail.com>2019-09-17 19:30:34 +0200
commit222e9201511bb9a6eaca7fc2c0ee0b85d78c4fd7 (patch)
tree5d4ce289fed354d6ffd2c9afad6b5320f77fc01a
parent9f4351d406fe904a99a7588ebb1411e369ba71f7 (diff)
downloadrust-222e9201511bb9a6eaca7fc2c0ee0b85d78c4fd7.tar.gz
rust-222e9201511bb9a6eaca7fc2c0ee0b85d78c4fd7.zip
Bless output of test borrowck/return-local-binding-from-desugaring.rs for Polonius
-rw-r--r--src/test/ui/borrowck/return-local-binding-from-desugaring.polonius.stderr16
1 files changed, 16 insertions, 0 deletions
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`.