summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generic-associated-types/impl_bounds.rs
blob: 01165fcebaf778c1b82813a6cda1f62eb130c07c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#![feature(associated_type_defaults)]

trait Foo {
    type A<'a> where Self: 'a;
    type B<'a, 'b> where 'a: 'b;
    type C where Self: Clone;
    fn d() where Self: Clone;
}

#[derive(Copy, Clone)]
struct Fooy<T>(T);

impl<T> Foo for Fooy<T> {
    type A<'a> = (&'a ()) where Self: 'static;
    //~^ ERROR impl has stricter requirements than trait
    type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
    //~^ ERROR impl has stricter requirements than trait
    //~| ERROR lifetime bound not satisfied
    type C = String where Self: Copy;
    //~^ ERROR the trait bound `T: Copy` is not satisfied
    fn d() where Self: Copy {}
    //~^ ERROR the trait bound `T: Copy` is not satisfied
}

fn main() {}