]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/impl_bounds.rs
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / generic-associated-types / impl_bounds.rs
1 #![feature(associated_type_defaults)]
2
3 trait Foo {
4     type A<'a> where Self: 'a;
5     type B<'a, 'b> where 'a: 'b;
6     type C where Self: Clone;
7     fn d() where Self: Clone;
8 }
9
10 #[derive(Copy, Clone)]
11 struct Fooy<T>(T);
12
13 impl<T> Foo for Fooy<T> {
14     type A<'a> = (&'a ()) where Self: 'static;
15     //~^ ERROR impl has stricter requirements than trait
16     type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
17     //~^ ERROR impl has stricter requirements than trait
18     //~| ERROR lifetime bound not satisfied
19     type C = String where Self: Copy;
20     //~^ ERROR the trait bound `T: Copy` is not satisfied
21     fn d() where Self: Copy {}
22     //~^ ERROR the trait bound `T: Copy` is not satisfied
23 }
24
25 fn main() {}