summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-creating-enums.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/regions/regions-creating-enums.stderr')
-rw-r--r--tests/ui/regions/regions-creating-enums.stderr21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/regions/regions-creating-enums.stderr b/tests/ui/regions/regions-creating-enums.stderr
new file mode 100644
index 000000000..a95d84629
--- /dev/null
+++ b/tests/ui/regions/regions-creating-enums.stderr
@@ -0,0 +1,21 @@
+error[E0515]: cannot return reference to temporary value
+ --> $DIR/regions-creating-enums.rs:23:16
+ |
+LL | return &Ast::Num((*f)(x));
+ | ^-----------------
+ | ||
+ | |temporary value created here
+ | returns a reference to data owned by the current function
+
+error[E0515]: cannot return reference to temporary value
+ --> $DIR/regions-creating-enums.rs:28:16
+ |
+LL | return &Ast::Add(m_x, m_y);
+ | ^------------------
+ | ||
+ | |temporary value created here
+ | returns a reference to data owned by the current function
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0515`.