rust-lang/rust-clippy

New Lint: No recursion without tail calls

Open

#1,678 建立於 2017年4月15日

在 GitHub 查看
 (7 留言) (0 反應) (0 負責人)Rust (1,391 fork)batch import
A-lintL-perfT-middlegood first issue

倉庫指標

Star
 (10,406 star)
PR 合併指標
 (平均合併 19天 22小時) (30 天內合併 113 個 PR)

描述

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.

貢獻者指南