error: borrowed data escapes outside of function --> $DIR/lifetime-bound-will-change-warning.rs:44:5 | LL | fn test2<'a>(x: &'a Box) { | - `x` is a reference that is only valid in the function body LL | // but ref_obj will not, so warn. LL | ref_obj(x) //~ ERROR mismatched types | ^^^^^^^^^^ `x` escapes the function body here error: borrowed data escapes outside of function --> $DIR/lifetime-bound-will-change-warning.rs:49:5 | LL | fn test2cc<'a>(x: &'a Box) { | - `x` is a reference that is only valid in the function body LL | // same as test2, but cross crate LL | lib::ref_obj(x) //~ ERROR mismatched types | ^^^^^^^^^^^^^^^ `x` escapes the function body here error: aborting due to 2 previous errors