rust/tests/ui/lifetimes/unit-struct-as-rvalue.stderr
2026-01-22 19:50:00 +01:00

11 lines
419 B
Text

error[E0515]: cannot return value referencing temporary value
--> $DIR/unit-struct-as-rvalue.rs:14:10
|
LL | let testValue = &Test;
| ---- temporary value created here
LL | return testValue;
| ^^^^^^^^^ returns a value referencing data owned by the current function
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0515`.