2022-12-14 12:30:46 -06:00
|
|
|
// Adapted from rustc ui test suite (ui/type-alias-impl-trait/issue-72793.rs)
|
|
|
|
|
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
|
2023-04-29 07:00:43 -05:00
|
|
|
trait T {
|
|
|
|
type Item;
|
|
|
|
}
|
2022-12-14 12:30:46 -06:00
|
|
|
|
|
|
|
type Alias<'a> = impl T<Item = &'a ()>;
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
impl<'a> T for &'a S {
|
|
|
|
type Item = &'a ();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn filter_positive<'a>() -> Alias<'a> {
|
|
|
|
&S
|
|
|
|
}
|
|
|
|
|
|
|
|
fn with_positive(fun: impl Fn(Alias<'_>)) {
|
|
|
|
fun(filter_positive());
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
with_positive(|_| ());
|
|
|
|
}
|