about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlqd <remy.rakic+github@gmail.com>2019-07-15 18:04:41 +0200
committerlqd <remy.rakic+github@gmail.com>2019-07-22 11:36:44 +0200
commit0bd2b3235808e50f1568d89bb85e2ec6f8397e49 (patch)
treedccf5c75853277706efb5d4bfe2d59b3e4df92ba
parent6d9a4f978313798a275a150ffd0f103609484ebd (diff)
downloadrust-0bd2b3235808e50f1568d89bb85e2ec6f8397e49.tar.gz
rust-0bd2b3235808e50f1568d89bb85e2ec6f8397e49.zip
Bless output of test borrowck/promote-ref-mut-in-let-issue-46557.rs for Polonius
-rw-r--r--src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.polonius.stderr59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.polonius.stderr b/src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.polonius.stderr
new file mode 100644
index 00000000000..a5b2e876274
--- /dev/null
+++ b/src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.polonius.stderr
@@ -0,0 +1,59 @@
+error[E0716]: temporary value dropped while borrowed
+  --> $DIR/promote-ref-mut-in-let-issue-46557.rs:5:21
+   |
+LL |     let ref mut x = 1234543;
+   |                     ^^^^^^^ creates a temporary which is freed while still in use
+LL |     x
+   |     - borrow later used here
+LL | }
+   | - temporary value is freed at the end of this statement
+   |
+   = note: consider using a `let` binding to create a longer lived value
+
+error[E0716]: temporary value dropped while borrowed
+  --> $DIR/promote-ref-mut-in-let-issue-46557.rs:10:25
+   |
+LL |     let (ref mut x, ) = (1234543, );
+   |                         ^^^^^^^^^^^ creates a temporary which is freed while still in use
+LL |     x
+   |     - borrow later used here
+LL | }
+   | - temporary value is freed at the end of this statement
+   |
+   = note: consider using a `let` binding to create a longer lived value
+
+error[E0515]: cannot return value referencing temporary value
+  --> $DIR/promote-ref-mut-in-let-issue-46557.rs:15:5
+   |
+LL |       match 1234543 {
+   |       ^     ------- temporary value created here
+   |  _____|
+   | |
+LL | |         ref mut x => x
+LL | |     }
+   | |_____^ returns a value referencing data owned by the current function
+
+error[E0515]: cannot return value referencing temporary value
+  --> $DIR/promote-ref-mut-in-let-issue-46557.rs:21:5
+   |
+LL |       match (123443,) {
+   |       ^     --------- temporary value created here
+   |  _____|
+   | |
+LL | |         (ref mut x,) => x,
+LL | |     }
+   | |_____^ returns a value referencing data owned by the current function
+
+error[E0515]: cannot return reference to temporary value
+  --> $DIR/promote-ref-mut-in-let-issue-46557.rs:27:5
+   |
+LL |     &mut 1234543
+   |     ^^^^^-------
+   |     |    |
+   |     |    temporary value created here
+   |     returns a reference to data owned by the current function
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0515, E0716.
+For more information about an error, try `rustc --explain E0515`.