“closure references itself” error when it’s not #97680
Labels
A-closures
Area: Closures (`|…| { … }`)
A-inference
Area: Type inference
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code (playground):
Trying to compile it produces the following error:
I’m not sure if it should compile, but the diagnostic is misleading either way: this closure doesn’t have infinite size (in fact, it’s zero-sized), doesn’t capture itself (it captures nothing) and doesn’t take itself as argument (it only takes
()
).I don’t see a reason why it shouldn’t compile though, since all the types are known without evaluating the recursive bound on
hrc()
.Meta
This bug is reproducible on playground on stable, beta and nightly (1.61.0, 1.62.0-beta3 and 1.63.0-nightly (2022-06-02 e714405) respectively)
Links
The text was updated successfully, but these errors were encountered: