// Taken from https://github.com/rust-lang/rust/issues/44454#issue-256435333 trait Animal: 'static {} fn foo() where Y: Animal + ?Sized, { // `Y` implements `Animal` so `Y` is 'static. baz::() } fn bar<'a>(_arg: &'a i32) { foo::, &'a i32>() //~ ERROR: lifetime may not live long enough } fn baz() {} fn main() { let a = 5; bar(&a); }