Regression test for #63154.

This commit is contained in:
Felix S. Klock II 2019-10-04 14:21:12 +02:00
parent c59d33a063
commit 6dd86b411f

View file

@ -0,0 +1,34 @@
// Regression test for rust-lang/rust#63154
//
// Before, we would ICE after faiing to normalize the destination type
// when checking call destinations and also when checking MIR
// assignment statements.
// check-pass
trait HasAssocType {
type Inner;
}
impl HasAssocType for () {
type Inner = ();
}
trait Tr<I, T>: Fn(I) -> Option<T> {}
impl<I, T, Q: Fn(I) -> Option<T>> Tr<I, T> for Q {}
fn f<T: HasAssocType>() -> impl Tr<T, T::Inner> {
|_| None
}
fn g<T, Y>(f: impl Tr<T, Y>) -> impl Tr<T, Y> {
f
}
fn h() {
g(f())(());
}
fn main() {
h();
}