2018-08-08 14:28:26 +02:00
|
|
|
error[E0597]: borrowed value does not live long enough
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:14:20
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let testValue = &id(Test);
|
|
|
|
| ^^^^^^^^ temporary value does not live long enough
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - temporary value only lives until here
|
|
|
|
|
|
2018-12-25 08:56:47 -07:00
|
|
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:19...
|
|
|
|
--> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:13:19
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | fn structLifetime<'a>() -> &'a Test {
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error[E0597]: borrowed value does not live long enough
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:20:20
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let testValue = &id(MyEnum::Variant1);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - temporary value only lives until here
|
|
|
|
|
|
2018-12-25 08:56:47 -07:00
|
|
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 19:20...
|
|
|
|
--> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:19:20
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | fn variantLifetime<'a>() -> &'a MyEnum {
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|