Skip to content

Commit 5c8c487

Browse files
committed
Add implementation for the EarlyLintPass trait into the Adding Lints documentation.
To follow along with the adding lint documentation you need to implement this trait in order to register the lint pass.
1 parent 92612c9 commit 5c8c487

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/adding_lints.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ where all the lint code is. We are going to call the file
115115
`clippy_lints/src/foo_functions.rs` and import some initial things we need:
116116

117117
```rust
118-
use rustc::lint::{LintArray, LintPass};
118+
use rustc::lint::{LintArray, LintPass, EarlyLintPass};
119119
use rustc::{declare_tool_lint, lint_array};
120120
```
121121

@@ -161,6 +161,8 @@ impl LintPass for FooFunctionsPass {
161161
"FooFunctions"
162162
}
163163
}
164+
165+
impl EarlyLintPass for FooFunctionsPass {}
164166
```
165167

166168
Don't worry about the `name` method here. As long as it includes the name of the

0 commit comments

Comments
 (0)