1 // Test that `dyn Bar<Item = XX>` uses `'static` as the default object
2 // lifetime bound for the type `XX`.
5 type Item: 'a + ?Sized;
7 fn item(&self) -> Box<Self::Item> { panic!() }
12 impl<T> Foo<'_> for T {
16 fn is_static<T>(_: T) where T: 'static { }
18 // Here, we default to `dyn Bar + 'a`. Or, we *should*, but the
19 // current code forces us into a conservative, hacky path.
20 fn bar<'a>(x: &'a str) -> &'a dyn Foo<'a, Item = dyn Bar> { &() }
21 //~^ ERROR please supply an explicit bound
24 let s = format!("foo");
27 // If it weren't for the conservative path above, we'd expect an