error[E0308]: mismatched types --> $DIR/lifetime-bound-will-change-warning.rs:38:13 | LL | ref_obj(x) | ^ lifetime mismatch | = note: expected reference `&Box<(dyn Fn() + 'static)>` found reference `&Box<(dyn Fn() + 'a)>` note: the lifetime `'a` as defined here... --> $DIR/lifetime-bound-will-change-warning.rs:36:10 | LL | fn test2<'a>(x: &'a Box) { | ^^ = note: ...does not necessarily outlive the static lifetime error[E0308]: mismatched types --> $DIR/lifetime-bound-will-change-warning.rs:45:18 | LL | lib::ref_obj(x) | ^ lifetime mismatch | = note: expected reference `&Box<(dyn Fn() + 'static)>` found reference `&Box<(dyn Fn() + 'a)>` note: the lifetime `'a` as defined here... --> $DIR/lifetime-bound-will-change-warning.rs:43:12 | LL | fn test2cc<'a>(x: &'a Box) { | ^^ = note: ...does not necessarily outlive the static lifetime error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`.