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