about summary refs log tree commit diff
path: root/src/librustdoc/lint.rs
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2021-03-16 11:59:05 -0400
committerJoshua Nelson <jyn514@gmail.com>2021-03-16 13:13:59 -0400
commitc1b99f0b905f3aec1e44d312a692c5df4440bcd1 (patch)
treef9c08ddf321d2940a0947e81044700fbfedb5250 /src/librustdoc/lint.rs
parentf24ce9b0140d9be5a336954e878d0c1522966bb8 (diff)
downloadrust-c1b99f0b905f3aec1e44d312a692c5df4440bcd1.tar.gz
rust-c1b99f0b905f3aec1e44d312a692c5df4440bcd1.zip
Don't warn about old rustdoc lint names (temporarily)
Right now, rustdoc users have an unpleasant situation: they can either
use the new tool lint names (`rustdoc::non_autolinks`) or they can use
the old names (`non_autolinks`). If they use the tool lints, they get a
hard error on stable compilers, because rustc rejects all tool names it
doesn't recognize. If they use the old name, they get a warning to
rename the lint to the new name. The only way to compile without
warnings is to add `#[allow(renamed_removed_lints)]`, which defeats the
whole point of the change: we *want* people to switch to the new name.

To avoid people silencing the lint and never migrating to the tool lint,
this avoids warning about the old name, while still allowing you to use
the new name. Once the new `rustdoc` tool name makes it to the stable
channel, we can change these lints to warn again.

This adds the new lint functions `register_alias` and `register_ignored`
- I didn't see an existing way to do this.
Diffstat (limited to 'src/librustdoc/lint.rs')
-rw-r--r--src/librustdoc/lint.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/lint.rs b/src/librustdoc/lint.rs
index 754ec53b330..ffa2f7a47fd 100644
--- a/src/librustdoc/lint.rs
+++ b/src/librustdoc/lint.rs
@@ -181,7 +181,7 @@ crate fn register_lints(_sess: &Session, lint_store: &mut LintStore) {
     );
     for lint in &*RUSTDOC_LINTS {
         let name = lint.name_lower();
-        lint_store.register_renamed(&name.replace("rustdoc::", ""), &name);
+        lint_store.register_alias(&name.replace("rustdoc::", ""), &name);
     }
     lint_store
         .register_renamed("intra_doc_link_resolution_failure", "rustdoc::broken_intra_doc_links");