Skip to content

Commit dc825a3

Browse files
committed
Auto merge of #3894 - markcatley:adding_lint_documentation_fixes, r=phansch
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.
2 parents 92612c9 + 5c8c487 commit dc825a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/adding_lints.md

+3-1
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)