Skip to content

Commit 4794acc

Browse files
authored
Rollup merge of rust-lang#75695 - JohnTitor:regression-test, r=Dylan-DPC
Add a regression test for issue-72793 Adds a regression test for rust-lang#72793, which is fixed by rust-lang#75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
2 parents 5e60cf8 + 18ad5a5 commit 4794acc

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)