Skip to content

Commit 6dd86b4

Browse files
committed
Regression test for #63154.
1 parent c59d33a commit 6dd86b4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Regression test for rust-lang/rust#63154
2+
//
3+
// Before, we would ICE after faiing to normalize the destination type
4+
// when checking call destinations and also when checking MIR
5+
// assignment statements.
6+
7+
// check-pass
8+
9+
trait HasAssocType {
10+
type Inner;
11+
}
12+
13+
impl HasAssocType for () {
14+
type Inner = ();
15+
}
16+
17+
trait Tr<I, T>: Fn(I) -> Option<T> {}
18+
impl<I, T, Q: Fn(I) -> Option<T>> Tr<I, T> for Q {}
19+
20+
fn f<T: HasAssocType>() -> impl Tr<T, T::Inner> {
21+
|_| None
22+
}
23+
24+
fn g<T, Y>(f: impl Tr<T, Y>) -> impl Tr<T, Y> {
25+
f
26+
}
27+
28+
fn h() {
29+
g(f())(());
30+
}
31+
32+
fn main() {
33+
h();
34+
}

0 commit comments

Comments
 (0)