Skip to content

Commit 18ad5a5

Browse files
committed
Add a regression test for issue-72793
1 parent c03c213 commit 18ad5a5

File tree

1 file changed

+27
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)