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

trait X {
    type Y<'a, 'b>;
}

struct Foo<'a, 'b, 'c> {
    a: &'a u32,
    b: &'b str,
    c: &'c str,
}

fn foo<'c, 'd>(_arg: Box<dyn X<Y = (&'c u32, &'d u32)>>) {}
//~^ ERROR missing generics for associated type

fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b>) {}
//~^ ERROR this struct takes 3 lifetime arguments but 2 lifetime

fn f<'a>(_arg: Foo<'a>) {}
//~^ ERROR this struct takes 3 lifetime arguments but 1 lifetime

fn main() {}