Skip to content

Commit afd8cf2

Browse files
committed
add test for 72793
Fixes #72793 r? @oli-obk
1 parent 3fcf43b commit afd8cf2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// check-pass
2+
// compile-flags: -Zmir-opt-level=3
3+
4+
#![feature(type_alias_impl_trait)]
5+
6+
trait T { type Item; }
7+
8+
type Alias<'a> = impl T<Item = &'a ()>;
9+
10+
struct S;
11+
impl<'a> T for &'a S {
12+
type Item = &'a ();
13+
}
14+
15+
fn filter_positive<'a>() -> Alias<'a> {
16+
&S
17+
}
18+
19+
fn with_positive(fun: impl Fn(Alias<'_>)) {
20+
fun(filter_positive());
21+
}
22+
23+
fn main() {
24+
with_positive(|_| ());
25+
}

0 commit comments

Comments
 (0)