1 // Regression test for #54593: the MIR type checker was going wrong
2 // when a closure returns the `impl Copy` from its parent fn. It was
3 // (incorrectly) replacing the `impl Copy` in its return type with the
4 // hidden type (`()`) but that type resulted from a recursive call to
5 // `foo` and hence is treated opaquely within the closure body. This
6 // resulted in a failed subtype relationship.
10 fn foo() -> impl Copy { || foo(); }
11 fn bar() -> impl Copy { || bar(); }