about summary refs log tree commit diff
path: root/tests/ui/type-alias-impl-trait/in-assoc-ty-early-bound.rs
blob: 013651e87759ecf585cb1caa7cd379baa22ba6a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![feature(impl_trait_in_assoc_type)]

trait Foo {
    type Assoc<'a, 'b>;
    fn bar<'a: 'a, 'b: 'b>(_: &'a ()) -> Self::Assoc<'a, 'b>;
}

impl Foo for () {
    type Assoc<'a, 'b> = impl Sized;
    fn bar<'a: 'a, 'b: 'b>(x: &'a ()) -> Self::Assoc<'a, 'b> {
        let closure = |x: &'a ()| -> Self::Assoc<'b, 'a> { x };
        //~^ ERROR expected generic lifetime parameter, found `'_`
        x
    }
}

fn main() {}