]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/impl_bounds.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / 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     type C = String where Self: Copy;
19     //~^ ERROR the trait bound `T: Copy` is not satisfied
20     fn d() where Self: Copy {}
21     //~^ ERROR the trait bound `T: Copy` is not satisfied
22 }
23
24 fn main() {}