Skip to content

Commit b1af2f0

Browse files
NadrierilJoshua Nelson
authored andcommitted
Explain lint renaming/removing
1 parent 132df62 commit b1af2f0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/diagnostics.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,21 @@ If you need a combination of options that's not supported by the
591591
- Later, change lint to error.
592592
- Eventually, remove lint.
593593

594+
### Renaming or removing a lint
595+
596+
A lint can be renamed or removed, which will trigger a warning if a user tries
597+
to use the old lint name. To declare a rename/remove, add a line with
598+
[`store.register_renamed`] or [`store.register_removed`] to the code of the
599+
[`register_builtins`] function.
600+
601+
```rust,ignore
602+
store.register_renamed("single_use_lifetime", "single_use_lifetimes");
603+
```
604+
605+
[`store.register_renamed`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LintStore.html#method.register_renamed
606+
[`store.register_removed`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LintStore.html#method.register_removed
607+
[`register_builtins`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/fn.register_builtins.html
608+
594609
### Lint Groups
595610

596611
Lints can be turned on in groups. These groups are declared in the

0 commit comments

Comments
 (0)