]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/object/supertrait-lifetime-bound.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / traits / object / supertrait-lifetime-bound.rs
1 trait Foo: 'static { }
2
3 trait Bar<T>: Foo { }
4
5 fn test1<T: ?Sized + Bar<S>, S>() { }
6
7 fn test2<'a>() {
8 // Here: the type `dyn Bar<&'a u32>` references `'a`,
9 // and so it does not outlive `'static`.
10 test1::<dyn Bar<&'a u32>, _>();
11 //~^ ERROR the type `(dyn Bar<&'a u32> + 'static)` does not fulfill the required lifetime
12 }
13
14 fn main() { }