Skip to content

Commit 47b21b8

Browse files
committed
Add PRIVATE_INTRA_DOC_LINKS to rustdoc special-casing
This is really starting to get out of hand. Rustdoc should instead allow all lints in the rustdoc lint group.
1 parent eed0ceb commit 47b21b8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/librustdoc/core.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ pub fn run_core(
322322
let cpath = Some(input.clone());
323323
let input = Input::File(input);
324324

325-
let intra_link_resolution_failure_name = lint::builtin::BROKEN_INTRA_DOC_LINKS.name;
325+
let broken_intra_doc_links = lint::builtin::BROKEN_INTRA_DOC_LINKS.name;
326+
let private_intra_doc_links = lint::builtin::PRIVATE_INTRA_DOC_LINKS.name;
326327
let missing_docs = rustc_lint::builtin::MISSING_DOCS.name;
327328
let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name;
328329
let private_doc_tests = rustc_lint::builtin::PRIVATE_DOC_TESTS.name;
@@ -335,7 +336,8 @@ pub fn run_core(
335336
// In addition to those specific lints, we also need to allow those given through
336337
// command line, otherwise they'll get ignored and we don't want that.
337338
let lints_to_show = vec![
338-
intra_link_resolution_failure_name.to_owned(),
339+
broken_intra_doc_links.to_owned(),
340+
private_intra_doc_links.to_owned(),
339341
missing_docs.to_owned(),
340342
missing_doc_example.to_owned(),
341343
private_doc_tests.to_owned(),
@@ -347,9 +349,8 @@ pub fn run_core(
347349
];
348350

349351
let (lint_opts, lint_caps) = init_lints(lints_to_show, lint_opts, |lint| {
350-
if lint.name == intra_link_resolution_failure_name
351-
|| lint.name == invalid_codeblock_attributes_name
352-
{
352+
// FIXME: why is this necessary?
353+
if lint.name == broken_intra_doc_links || lint.name == invalid_codeblock_attributes_name {
353354
None
354355
} else {
355356
Some((lint.name_lower(), lint::Allow))

0 commit comments

Comments
 (0)