type checker takes O(~1.5^recursion_limit) time to reject simple-ish code #40353
Labels
A-trait-system
Area: Trait system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-compiletime
Issue: Problems and improvements with respect to compile times.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Found when trying to port my old type system Brainfuck interpreter to use associated types. Reduced case:
I don't really understand what's going on, but as written, rustc outputs:
However, increasing the recursion_limit dramatically increases the time it takes to report the error.
Note that writing the impl more normally as
fails instantly even with a high recursion limit. But I don't see why it should fail at all: the impl is sane enough, implementing
BF
for a larger type based on its implementation for a smaller type.The text was updated successfully, but these errors were encountered: