Skip to content

Commit e2861d5

Browse files
committed
Encourage using LateLintPass
1 parent 971e435 commit e2861d5

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
@@ -297,10 +297,10 @@ This is good, because it makes writing this particular lint less complicated.
297297
We have to make this decision with every new Clippy lint. It boils down to using
298298
either [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass].
299299

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

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

0 commit comments

Comments
 (0)