19 lines
657 B
Plaintext
19 lines
657 B
Plaintext
error[E0597]: borrowed value does not live long enough
|
|
--> $DIR/borrowck-borrow-from-temporary.rs:9:24
|
|
|
|
|
LL | let &Foo(ref x) = &id(Foo(3)); //~ ERROR borrowed value does not live long enough
|
|
| ^^^^^^^^^^ temporary value does not live long enough
|
|
LL | x
|
|
LL | }
|
|
| - temporary value only lives until here
|
|
|
|
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 8:8...
|
|
--> $DIR/borrowck-borrow-from-temporary.rs:8:8
|
|
|
|
|
LL | fn foo<'a>() -> &'a isize {
|
|
| ^^
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|