-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Exponential slowdown in catching an overflow error. #91949
Copy link
Copy link
Closed
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.perf-regressionPerformance regression.Performance regression.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.perf-regressionPerformance regression.Performance regression.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This code is not expected to compile successfully:
This can't compile successfully because
recurse<T>callsrecurse<Map<IteratorOfWrapped<(), T>, [closure@<source>:22:51: 22:58]>>recursively, which then callsrecurse<Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), T>, [closure@<source>:22:51: 22:58]>>, [closure@<source>:22:51: 22:58]>>, and so on...However up to stable 1.55, the code failed to compile quickly with the default recursion limit. On the compiler explorer, you can see it even handling
#![recursion_limit = "800"]without timeout. However, go to 1.56 and it no longer reaches a compilation error in time with#![recursion_limit = "30"]. Still just as slow on nightly (rustc 1.59.0-nightly (6bda5b331 2021-12-12)).@rustbot label: regression-from-stable-to-stable, perf-regression, I-compiletime, T-compiler, E-needs-bisection
Comes from: https://users.rust-lang.org/t/compiler-hanging/68804
Rough estimate on my machine: In the area of
recursion_limitbeing20-30, the time more-than doubles for each increase of the recursion limit by2or3, so it really is exponential AFAICT.