2018-09-26 20:37:31 +00:00
|
|
|
// Regression test for #54593: the MIR type checker was going wrong
|
|
|
|
// when a closure returns the `impl Copy` from its parent fn. It was
|
|
|
|
// (incorrectly) replacing the `impl Copy` in its return type with the
|
|
|
|
// hidden type (`()`) but that type resulted from a recursive call to
|
|
|
|
// `foo` and hence is treated opaquely within the closure body. This
|
|
|
|
// resulted in a failed subtype relationship.
|
|
|
|
//
|
2019-09-01 21:30:19 +00:00
|
|
|
// check-pass
|
2018-09-26 20:37:31 +00:00
|
|
|
|
|
|
|
fn foo() -> impl Copy { || foo(); }
|
|
|
|
fn bar() -> impl Copy { || bar(); }
|
|
|
|
fn main() { }
|