error[E0597]: borrowed value does not live long enough --> $DIR/regions-ref-in-fn-arg.rs:4:17 | LL | fn arg_item(box ref x: Box) -> &'static isize { | ^^^^^ borrowed value does not live long enough LL | x //~^ ERROR borrowed value does not live long enough LL | } | - borrowed value only lives until here | = note: borrowed value must be valid for the static lifetime... error[E0597]: borrowed value does not live long enough --> $DIR/regions-ref-in-fn-arg.rs:11:15 | LL | with(|box ref x| x) //~ ERROR borrowed value does not live long enough | ^^^^^ - borrowed value only lives until here | | | borrowed value does not live long enough | = note: borrowed value must be valid for the static lifetime... error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0597`.