Improve error messages

- Use `register_renamed` when rustdoc is running so the lint will still
  be active and use a structured suggestion
- Test the behavior for rustc, not just for rustdoc (because it differs)
This commit is contained in:
Joshua Nelson 2021-01-17 18:52:19 -05:00
parent 7195355767
commit e8ddfda813
6 changed files with 49 additions and 9 deletions

View file

@ -167,6 +167,10 @@ crate fn register_lints(_sess: &Session, lint_store: &mut LintStore) {
None,
RUSTDOC_LINTS.iter().map(|&lint| LintId::of(lint)).collect(),
);
for lint in &*RUSTDOC_LINTS {
let name = lint.name_lower();
lint_store.register_renamed(&name.replace("rustdoc::", ""), &name);
}
lint_store
.register_renamed("intra_doc_link_resolution_failure", "rustdoc::broken_intra_doc_links");
}