]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-63154-normalize.rs
Rollup merge of #103146 - joboet:cleanup_pthread_condvar, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / issue-63154-normalize.rs
1 // Regression test for rust-lang/rust#63154
2 //
3 // Before, we would ICE after failing 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 }