]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/implied_lifetime_wf_check.rs
Rollup merge of #106732 - durin42:dmitrig-arrayref-ctor, r=nikic
[rust.git] / tests / ui / type-alias-impl-trait / implied_lifetime_wf_check.rs
1 #![feature(type_alias_impl_trait)]
2
3 // known-bug: #99840
4 // this should not compile
5 // check-pass
6
7 type Alias = impl Sized;
8
9 fn constrain() -> Alias {
10     1i32
11 }
12
13 trait HideIt {
14     type Assoc;
15 }
16
17 impl HideIt for () {
18     type Assoc = Alias;
19 }
20
21 pub trait Yay {}
22
23 impl Yay for <() as HideIt>::Assoc {}
24 // impl Yay for i32 {} // this already errors
25 // impl Yay for u32 {} // this also already errors
26
27 fn main() {}