]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-lifetime-of-struct-or-enum-variant.stderr
internally change regions to be covariant
[rust.git] / tests / ui / regions / regions-lifetime-of-struct-or-enum-variant.stderr
1 error[E0515]: cannot return value referencing temporary value
2   --> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:15:3
3    |
4 LL |   let testValue = &id(Test);
5    |                    -------- temporary value created here
6 LL |   testValue
7    |   ^^^^^^^^^ returns a value referencing data owned by the current function
8
9 error[E0515]: cannot return value referencing temporary value
10   --> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:21:3
11    |
12 LL |   let testValue = &id(MyEnum::Variant1);
13    |                    -------------------- temporary value created here
14 LL |   testValue
15    |   ^^^^^^^^^ returns a value referencing data owned by the current function
16
17 error: aborting due to 2 previous errors
18
19 For more information about this error, try `rustc --explain E0515`.