diff options
| author | blyxyas <blyxyas@gmail.com> | 2023-04-12 23:59:56 +0200 |
|---|---|---|
| committer | blyxyas <blyxyas@gmail.com> | 2023-04-12 23:59:56 +0200 |
| commit | b4732679fc63b3c66d830c3b7edf8bcbb84aff12 (patch) | |
| tree | ed77b103084b4b13ef151bf524211472503fc6ca | |
| parent | c19c08f4b20c078aa45d0ffe3149143a016d514b (diff) | |
| download | rust-b4732679fc63b3c66d830c3b7edf8bcbb84aff12.tar.gz rust-b4732679fc63b3c66d830c3b7edf8bcbb84aff12.zip | |
Talk about symbol information in "Early Lint Pass"
| -rw-r--r-- | book/src/development/lint_passes.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/book/src/development/lint_passes.md b/book/src/development/lint_passes.md index eadebc6d7f0..058b9fa3233 100644 --- a/book/src/development/lint_passes.md +++ b/book/src/development/lint_passes.md @@ -4,7 +4,7 @@ Before working on the logic of a new lint, there is an important decision that every Clippy developers must make: to use [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass]. -In short, the `LateLintPass` has access to type information while the +In short, the `LateLintPass` has access to type and symbol information while the `EarlyLintPass` doesn't. If you don't need access to type information, use the `EarlyLintPass`. @@ -20,14 +20,14 @@ you'll see that every method defined for this trait utilizes a VoilĂ . `EarlyLintPass` works only on the Abstract Syntax Tree (AST) level. And AST is generated during the [lexing and parsing][lexing_and_parsing] phase -of code compilation. Therefore, this is our trait choice for a new lint if -the lint only deals with syntax-related issues. +of code compilation. Therefore, it doesn't know what a symbol means or information about types, and it should +be our trait choice for a new lint if the lint only deals with syntax-related issues. While linting speed has not been a concern for Clippy, -the `EarlyLintPass` is faster and it should be your choice +the `EarlyLintPass` is faster, and it should be your choice if you know for sure a lint does not need type information. -As a reminder, run the following command to generate boilerplates for lints +As a reminder, run the following command to generate boilerplate for lints that use `EarlyLintPass`: ```sh |
