Skip to content

Commit 12f9ede

Browse files
ehussjyn514
authored andcommitted
Describe the difference of rustc_lint vs rustc_lint_defs.
1 parent 50de7f0 commit 12f9ede

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/diagnostics.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,13 @@ module.
484484
### Declaring a lint
485485

486486
The built-in compiler lints are defined in the [`rustc_lint`][builtin]
487-
crate.
487+
crate. Lints that need to be implemented in other crates are defined in
488+
[`rustc_lint_defs`]. You should prefer to place lints in `rustc_lint` if
489+
possible. One benefit is that it is close to the dependency root, so it can be
490+
much faster to work on.
488491

489492
[builtin]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/index.html
493+
[`rustc_lint_defs`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/index.html
490494

491495
Every lint is implemented via a `struct` that implements the `LintPass` `trait`
492496
(you also implement one of the more specific lint pass traits, either

0 commit comments

Comments
 (0)