Skip to content

Commit 7839890

Browse files
authored
Rollup merge of #98684 - matthiaskrgr:ice-test-72793, r=oli-obk
add test for 72793 Fixes #72793 r? ````@oli-obk````
2 parents 6ee6673 + afd8cf2 commit 7839890

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)