summaryrefslogtreecommitdiffstats
path: root/src/test/ui/regions/regions-lifetime-of-struct-or-enum-variant.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/regions/regions-lifetime-of-struct-or-enum-variant.stderr')
-rw-r--r--src/test/ui/regions/regions-lifetime-of-struct-or-enum-variant.stderr19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/regions/regions-lifetime-of-struct-or-enum-variant.stderr b/src/test/ui/regions/regions-lifetime-of-struct-or-enum-variant.stderr
new file mode 100644
index 000000000..b4bf2ab31
--- /dev/null
+++ b/src/test/ui/regions/regions-lifetime-of-struct-or-enum-variant.stderr
@@ -0,0 +1,19 @@
+error[E0515]: cannot return value referencing temporary value
+ --> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:15:3
+ |
+LL | let testValue = &id(Test);
+ | -------- temporary value created here
+LL | testValue
+ | ^^^^^^^^^ returns a value referencing data owned by the current function
+
+error[E0515]: cannot return value referencing temporary value
+ --> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:21:3
+ |
+LL | let testValue = &id(MyEnum::Variant1);
+ | -------------------- temporary value created here
+LL | testValue
+ | ^^^^^^^^^ returns a value referencing data owned by the current function
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0515`.