about summary refs log tree commit diff
path: root/tests/ui/type-alias-impl-trait/issue-70121.rs
blob: 5aec99a1c371f1416176f6736928f6709db6eca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![feature(type_alias_impl_trait)]

pub type Successors<'a> = impl Iterator<Item = &'a ()>;

#[define_opaque(Successors)]
pub fn f<'a>() -> Successors<'a> {
    None.into_iter()
}

pub trait Tr {
    type Item;
}

impl<'a> Tr for &'a () {
    type Item = Successors<'a>;
}

pub fn kazusa<'a>() -> <&'a () as Tr>::Item {
    None.into_iter()
    //~^ ERROR mismatched types
}

fn main() {}