blob: 60420973e1ee0359cfdba1b1d4d5e4539adae1b0 [file] [log] [blame]
error[E0521]: borrowed data escapes outside of function
--> $DIR/lifetime-bound-will-change-warning.rs:34:5
|
LL | fn test2<'a>(x: &'a Box<dyn Fn() + 'a>) {
| - `x` is a reference that is only valid in the function body
LL | // but ref_obj will not, so warn.
LL | ref_obj(x)
| ^^^^^^^^^^ `x` escapes the function body here
|
= help: consider replacing `'a` with `'static`
error[E0521]: borrowed data escapes outside of function
--> $DIR/lifetime-bound-will-change-warning.rs:39:5
|
LL | fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) {
| - `x` is a reference that is only valid in the function body
LL | // same as test2, but cross crate
LL | lib::ref_obj(x)
| ^^^^^^^^^^^^^^^ `x` escapes the function body here
|
= help: consider replacing `'a` with `'static`
error: aborting due to 2 previous errors