Skip to content

Commit d8e76ec

Browse files
committed
Auto merge of rust-lang#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 rust-lang#12595 changelog: none
2 parents 4261e0b + e2861d5 commit d8e76ec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

book/src/development/adding_lints.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ This is good, because it makes writing this particular lint less complicated.
299299
We have to make this decision with every new Clippy lint. It boils down to using
300300
either [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass].
301301

302-
In short, the `LateLintPass` has access to type information while the
303-
`EarlyLintPass` doesn't. If you don't need access to type information, use the
304-
`EarlyLintPass`. The `EarlyLintPass` is also faster. However, linting speed
305-
hasn't really been a concern with Clippy so far.
302+
In short, the `EarlyLintPass` runs before type checking and
303+
[HIR](https://rustc-dev-guide.rust-lang.org/hir.html) lowering and the `LateLintPass`
304+
has access to type information. Consider using the `LateLintPass` unless you need
305+
something specific from the `EarlyLintPass`.
306306

307307
Since we don't need type information for checking the function name, we used
308308
`--pass=early` when running the new lint automation and all the imports were

0 commit comments

Comments
 (0)