Skip to content

Commit

Permalink
Auto merge of #3894 - markcatley:adding_lint_documentation_fixes, r=p…
Browse files Browse the repository at this point in the history
…hansch

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.
  • Loading branch information
bors committed Mar 19, 2019
2 parents 92612c9 + 5c8c487 commit dc825a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ where all the lint code is. We are going to call the file
`clippy_lints/src/foo_functions.rs` and import some initial things we need:

```rust
use rustc::lint::{LintArray, LintPass};
use rustc::lint::{LintArray, LintPass, EarlyLintPass};
use rustc::{declare_tool_lint, lint_array};
```

Expand Down Expand Up @@ -161,6 +161,8 @@ impl LintPass for FooFunctionsPass {
"FooFunctions"
}
}

impl EarlyLintPass for FooFunctionsPass {}
```

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

0 comments on commit dc825a3

Please sign in to comment.