]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/impl_bounds.rs
Move some tests with compare-mode=nll output to revisions
[rust.git] / src / test / ui / generic-associated-types / impl_bounds.rs
1 #![feature(generic_associated_types)]
2 #![feature(associated_type_defaults)]
3
4 trait Foo {
5     type A<'a> where Self: 'a;
6     type B<'a, 'b> where 'a: 'b;
7     type C where Self: Clone;
8     fn d() 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> = (&'a ()) where Self: 'static;
16     //~^ ERROR `impl` associated type
17     type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
18     //~^ ERROR `impl` associated type
19     //~| ERROR lifetime bound not satisfied
20     type C = String where Self: Copy;
21     //~^ ERROR the trait bound `T: Copy` is not satisfied
22     fn d() where Self: Copy {}
23     //~^ ERROR the trait bound `T: Copy` is not satisfied
24 }
25
26 fn main() {}