// Test that `impl Alpha` resets the object-lifetime // default to `'static`. // //@ check-pass trait Alpha { fn item(&self) -> Box { panic!() } } trait Object {} impl Alpha for T {} fn alpha(x: &str, y: &str) -> impl Alpha { () } fn is_static(_: T) where T: 'static { } fn bar(x: &str) -> &impl Alpha { &() } fn main() { let s = format!("foo"); let r = bar(&s); is_static(r.item()); }