about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-30 12:51:27 +0000
committerbors <bors@rust-lang.org>2024-04-30 12:51:27 +0000
commitd8e76ecaf17dac26ca833ec86a15dd9f7f171792 (patch)
treebb4cfdad48d648440e0af100fbdc9254bf754f15
parent4261e0b28d3a98565f2fd55acf80a197774934cb (diff)
parente2861d56522591758b54200d75d7220c519fcf62 (diff)
downloadrust-d8e76ecaf17dac26ca833ec86a15dd9f7f171792.tar.gz
rust-d8e76ecaf17dac26ca833ec86a15dd9f7f171792.zip
Auto merge of #12596 - ARandomDev99:issue-12595, r=Alexendoo
Modify lint pass note for consistency with the book

This PR:
- removes the note which appears when an early lint pass is created using `cargo dev new_lint`.
- adds a note that encourages contributors to use an early pass unless type information is needed if a late lint pass is created using `cargo dev new_lint`.

Late pass remains the default value if no pass is specified as most lints use late pass.

Closes #12595

changelog: none
-rw-r--r--book/src/development/adding_lints.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/book/src/development/adding_lints.md b/book/src/development/adding_lints.md
index b80ac6370e7..415022612ca 100644
--- a/book/src/development/adding_lints.md
+++ b/book/src/development/adding_lints.md
@@ -299,10 +299,10 @@ This is good, because it makes writing this particular lint less complicated.
 We have to make this decision with every new Clippy lint. It boils down to using
 either [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass].
 
-In short, the `LateLintPass` has access to type information while the
-`EarlyLintPass` doesn't. If you don't need access to type information, use the
-`EarlyLintPass`. The `EarlyLintPass` is also faster. However, linting speed
-hasn't really been a concern with Clippy so far.
+In short, the `EarlyLintPass` runs before type checking and
+[HIR](https://rustc-dev-guide.rust-lang.org/hir.html) lowering and the `LateLintPass`
+has access to type information. Consider using the `LateLintPass` unless you need
+something specific from the `EarlyLintPass`.
 
 Since we don't need type information for checking the function name, we used
 `--pass=early` when running the new lint automation and all the imports were