error[E0716]: temporary value dropped while borrowed --> $DIR/borrowck-borrow-from-temporary.rs:19:24 | LL | let &Foo(ref x) = &id(Foo(3)); //~ ERROR borrowed value does not live long enough | ^^^^^^^^^^ creates a temporary which is freed while still in use LL | x LL | } | - temporary value is freed at the end of this statement | 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 E0716`.