rust/tests/ui/nll/issue-63154-normalize.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
579 B
Rust
Raw Normal View History

2019-10-04 12:21:12 +00:00
// Regression test for rust-lang/rust#63154
//
// Before, we would ICE after failing to normalize the destination type
2019-10-04 12:21:12 +00:00
// 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();
}