summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check.rs
blob: b6a7264a529fd5a0c6a26bb8a1cbe55e1865626d (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
26
27
#![feature(type_alias_impl_trait)]

// known-bug: #99840
// this should not compile
// check-pass

type Alias = impl Sized;

fn constrain() -> Alias {
    1i32
}

trait HideIt {
    type Assoc;
}

impl HideIt for () {
    type Assoc = Alias;
}

pub trait Yay {}

impl Yay for <() as HideIt>::Assoc {}
// impl Yay for i32 {} // this already errors
// impl Yay for u32 {} // this also already errors

fn main() {}