Skip to content

Commit b473267

Browse files
committed
Talk about symbol information in "Early Lint Pass"
1 parent c19c08f commit b473267

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

book/src/development/lint_passes.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Before working on the logic of a new lint, there is an important decision
44
that every Clippy developers must make: to use
55
[`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass].
66

7-
In short, the `LateLintPass` has access to type information while the
7+
In short, the `LateLintPass` has access to type and symbol information while the
88
`EarlyLintPass` doesn't. If you don't need access to type information, use the
99
`EarlyLintPass`.
1010

@@ -20,14 +20,14 @@ you'll see that every method defined for this trait utilizes a
2020
2121
Voilà. `EarlyLintPass` works only on the Abstract Syntax Tree (AST) level.
2222
And AST is generated during the [lexing and parsing][lexing_and_parsing] phase
23-
of code compilation. Therefore, this is our trait choice for a new lint if
24-
the lint only deals with syntax-related issues.
23+
of code compilation. Therefore, it doesn't know what a symbol means or information about types, and it should
24+
be our trait choice for a new lint if the lint only deals with syntax-related issues.
2525

2626
While linting speed has not been a concern for Clippy,
27-
the `EarlyLintPass` is faster and it should be your choice
27+
the `EarlyLintPass` is faster, and it should be your choice
2828
if you know for sure a lint does not need type information.
2929

30-
As a reminder, run the following command to generate boilerplates for lints
30+
As a reminder, run the following command to generate boilerplate for lints
3131
that use `EarlyLintPass`:
3232

3333
```sh

0 commit comments

Comments
 (0)