summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/return-local-binding-from-desugaring.stderr
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/borrowck/return-local-binding-from-desugaring.stderr12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/borrowck/return-local-binding-from-desugaring.stderr b/src/test/ui/borrowck/return-local-binding-from-desugaring.stderr
new file mode 100644
index 000000000..9f952542e
--- /dev/null
+++ b/src/test/ui/borrowck/return-local-binding-from-desugaring.stderr
@@ -0,0 +1,12 @@
+error[E0515]: cannot return value referencing temporary value
+ --> $DIR/return-local-binding-from-desugaring.rs:30:5
+ |
+LL | for ref x in xs {
+ | -- temporary value created here
+...
+LL | result
+ | ^^^^^^ returns a value referencing data owned by the current function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0515`.