about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2020-10-22 21:28:41 +0100
committerJoshua Nelson <joshua@yottadb.com>2020-10-22 20:41:09 -0400
commit7de7a026338e4f81d699222ca5aed009ff742aa8 (patch)
treeb6b44f645b41ec763f36d805241c59ea46a964da /src/doc/rustc-dev-guide
parent3ed54a3ff68ddbe2348ae9bfab23c695d9df9538 (diff)
downloadrust-7de7a026338e4f81d699222ca5aed009ff742aa8.tar.gz
rust-7de7a026338e4f81d699222ca5aed009ff742aa8.zip
Explain lint renaming/removing
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rw-r--r--src/doc/rustc-dev-guide/src/diagnostics.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/diagnostics.md b/src/doc/rustc-dev-guide/src/diagnostics.md
index a3293101fe6..04745ee9819 100644
--- a/src/doc/rustc-dev-guide/src/diagnostics.md
+++ b/src/doc/rustc-dev-guide/src/diagnostics.md
@@ -591,6 +591,21 @@ If you need a combination of options that's not supported by the
 - Later, change lint to error.
 - Eventually, remove lint.
 
+### Renaming or removing a lint
+
+A lint can be renamed or removed, which will trigger a warning if a user tries
+to use the old lint name. To declare a rename/remove, add a line with
+[`store.register_renamed`] or [`store.register_removed`] to the code of the
+[`register_builtins`] function.
+
+```rust,ignore
+store.register_renamed("single_use_lifetime", "single_use_lifetimes");
+```
+
+[`store.register_renamed`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LintStore.html#method.register_renamed
+[`store.register_removed`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LintStore.html#method.register_removed
+[`register_builtins`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/fn.register_builtins.html
+
 ### Lint Groups
 
 Lints can be turned on in groups. These groups are declared in the