]>
Commit | Line | Data |
---|---|---|
ee023bcb FG |
1 | #![feature(type_alias_impl_trait)] |
2 | ||
3 | // check-pass | |
4 | ||
5 | trait T { type Item; } | |
6 | ||
7 | type Alias<'a> = impl T<Item = &'a ()>; | |
8 | ||
9 | struct S; | |
10 | impl<'a> T for &'a S { | |
11 | type Item = &'a (); | |
12 | } | |
13 | ||
14 | fn filter_positive<'a>() -> Alias<'a> { | |
15 | &S | |
16 | } | |
17 | ||
18 | fn with_positive(fun: impl Fn(Alias<'_>)) { | |
19 | fun(filter_positive()); | |
20 | } | |
21 | ||
22 | fn main() { | |
23 | with_positive(|_| ()); | |
24 | } |