New Lint: No recursion without tail calls #1678
Labels
A-lint
Area: New lints
good-first-issue
These issues are a good way to get started with Clippy
L-perf
Lint: Belongs in the perf lint group
T-middle
Type: Probably requires verifiying types
Based on this HIC++ guideline.
The stack explodes much faster using recursion than a huge BFS work queue would explode the heap. Therefore, if clippy detects some direct or indirect recursion that does not benefit from tail call optimisation, clippy should issue a warning along with a short description about why this is potentially bad and a short hint on how to transform recursive algorithms to iterative ones (e.g. using a work queue and BFS). And maybe a tl;dr about what tail calls are and how to make the algorithm tail recursive.
The text was updated successfully, but these errors were encountered: