| error[E0597]: borrowed value does not live long enough |
| --> $DIR/borrowck-borrow-from-temporary.rs:19: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 18:8... |
| --> $DIR/borrowck-borrow-from-temporary.rs:18:8 |
| | |
| LL | fn foo<'a>() -> &'a isize { |
| | ^^ |
| |
| error: aborting due to previous error |
| |
| For more information about this error, try `rustc --explain E0597`. |