]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/impl_bounds.rs
Rollup merge of #82308 - estebank:issue-82290, r=lcnr
[rust.git] / src / test / ui / generic-associated-types / impl_bounds.rs
1 #![allow(incomplete_features)]
2 #![feature(generic_associated_types)]
3 #![feature(associated_type_defaults)]
4
5 trait Foo {
6     type A<'a> where Self: 'a;
7     type B<'a, 'b> where 'a: 'b;
8     type C where Self: Clone;
9 }
10
11 #[derive(Copy, Clone)]
12 struct Fooy<T>(T);
13
14 impl<T> Foo for Fooy<T> {
15     type A<'a> where Self: 'static = (&'a ());
16     //~^ ERROR the parameter type `T` may not live long enough
17     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
18     //~^ ERROR lifetime bound not satisfied
19     //~| ERROR lifetime bound not satisfied
20     type C where Self: Copy = String;
21     //~^ ERROR the trait bound `T: Copy` is not satisfied
22 }
23
24 fn main() {}