diff options
| author | Eric Huss <eric@huss.org> | 2021-05-25 17:05:34 -0700 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2021-05-25 21:37:21 -0400 |
| commit | 8ec3f77df939fe32ba693d4f3526544e7572759c (patch) | |
| tree | e7edd99357fb211eb84183987827da1fd612c3a0 /src/doc/rustc-dev-guide | |
| parent | 4727b9b396a8f3a4aecce2edd89405806d7bbb6d (diff) | |
| download | rust-8ec3f77df939fe32ba693d4f3526544e7572759c.tar.gz rust-8ec3f77df939fe32ba693d4f3526544e7572759c.zip | |
Describe the difference of rustc_lint vs rustc_lint_defs.
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/diagnostics.md | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/doc/rustc-dev-guide/src/diagnostics.md b/src/doc/rustc-dev-guide/src/diagnostics.md index f4e71bbdc4c..38683f98db7 100644 --- a/src/doc/rustc-dev-guide/src/diagnostics.md +++ b/src/doc/rustc-dev-guide/src/diagnostics.md @@ -484,9 +484,13 @@ module. ### Declaring a lint The built-in compiler lints are defined in the [`rustc_lint`][builtin] -crate. +crate. Lints that need to be implemented in other crates are defined in +[`rustc_lint_defs`]. You should prefer to place lints in `rustc_lint` if +possible. One benefit is that it is close to the dependency root, so it can be +much faster to work on. [builtin]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/index.html +[`rustc_lint_defs`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/index.html Every lint is implemented via a `struct` that implements the `LintPass` `trait` (you also implement one of the more specific lint pass traits, either |
