From abaf38ccb08d64a2a2c6b5d66dca2b58c2427664 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 29 Jul 2020 15:22:13 -0700 Subject: [PATCH 01/10] Rename intra_doc_link_resolution_failure -> intra_doc_link_resolution_failures --- src/librustc_lint/lib.rs | 4 ++-- src/librustc_session/lint/builtin.rs | 4 ++-- src/librustdoc/core.rs | 2 +- src/librustdoc/passes/collect_intra_doc_links.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index ab30d545edfc3..ee5ea6a9a192e 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -62,7 +62,7 @@ use rustc_middle::ty::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_session::lint::builtin::{ BARE_TRAIT_OBJECTS, ELIDED_LIFETIMES_IN_PATHS, EXPLICIT_OUTLIVES_REQUIREMENTS, - INTRA_DOC_LINK_RESOLUTION_FAILURE, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, + INTRA_DOC_LINK_RESOLUTION_FAILURES, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS, }; use rustc_span::symbol::{Ident, Symbol}; @@ -303,7 +303,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) { add_lint_group!( "rustdoc", - INTRA_DOC_LINK_RESOLUTION_FAILURE, + INTRA_DOC_LINK_RESOLUTION_FAILURES, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS diff --git a/src/librustc_session/lint/builtin.rs b/src/librustc_session/lint/builtin.rs index aa2a133952f8f..3e93c430c1f53 100644 --- a/src/librustc_session/lint/builtin.rs +++ b/src/librustc_session/lint/builtin.rs @@ -398,7 +398,7 @@ declare_lint! { } declare_lint! { - pub INTRA_DOC_LINK_RESOLUTION_FAILURE, + pub INTRA_DOC_LINK_RESOLUTION_FAILURES, Warn, "failures in resolving intra-doc link targets" } @@ -601,7 +601,7 @@ declare_lint_pass! { ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE, UNSTABLE_NAME_COLLISIONS, IRREFUTABLE_LET_PATTERNS, - INTRA_DOC_LINK_RESOLUTION_FAILURE, + INTRA_DOC_LINK_RESOLUTION_FAILURES, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_CRATE_LEVEL_DOCS, MISSING_DOC_CODE_EXAMPLES, diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 263909d5559d1..ecd6a28bcecf9 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -315,7 +315,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt let cpath = Some(input.clone()); let input = Input::File(input); - let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE.name; + let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURES.name; let missing_docs = rustc_lint::builtin::MISSING_DOCS.name; let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name; let private_doc_tests = rustc_lint::builtin::PRIVATE_DOC_TESTS.name; diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 418238181e9b8..c65905ade31f1 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -868,7 +868,7 @@ fn report_diagnostic( let sp = span_of_attrs(attrs).unwrap_or(item.source.span()); cx.tcx.struct_span_lint_hir( - lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE, + lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURES, hir_id, sp, |lint| { From 48de8ac0416853aaf76fcbe721efe9f11e27bd9d Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 29 Jul 2020 15:21:26 -0700 Subject: [PATCH 02/10] Rename usage of intra_doc_link_resolution_failure --- src/doc/rustdoc/src/lints.md | 2 +- src/test/run-make-fulldeps/exit-code/lint-failure.rs | 2 +- src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs | 2 +- src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr | 2 +- src/test/rustdoc-ui/intra-doc-alias-ice.rs | 2 +- src/test/rustdoc-ui/intra-doc-alias-ice.stderr | 2 +- src/test/rustdoc-ui/intra-link-span-ice-55723.rs | 2 +- src/test/rustdoc-ui/intra-link-span-ice-55723.stderr | 2 +- src/test/rustdoc-ui/intra-links-ambiguity.rs | 2 +- src/test/rustdoc-ui/intra-links-ambiguity.stderr | 2 +- src/test/rustdoc-ui/intra-links-anchors.rs | 2 +- src/test/rustdoc-ui/intra-links-anchors.stderr | 2 +- src/test/rustdoc-ui/intra-links-private.private.stderr | 2 +- src/test/rustdoc-ui/intra-links-private.public.stderr | 2 +- src/test/rustdoc-ui/intra-links-warning-crlf.stderr | 2 +- src/test/rustdoc-ui/intra-links-warning.stderr | 2 +- src/test/rustdoc-ui/issue-74134.private.stderr | 2 +- src/test/rustdoc-ui/issue-74134.public.stderr | 2 +- src/test/rustdoc-ui/lint-group.stderr | 2 +- src/test/rustdoc-ui/reference-link-has-one-warning.stderr | 2 +- src/test/rustdoc/intra-doc-crate/additional_doc.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/module.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs | 2 +- src/test/rustdoc/intra-doc-crate/basic.rs | 2 +- src/test/rustdoc/intra-doc-crate/hidden.rs | 2 +- src/test/rustdoc/intra-doc-crate/macro.rs | 2 +- src/test/rustdoc/intra-doc-crate/module.rs | 2 +- src/test/rustdoc/intra-doc-crate/submodule-inner.rs | 2 +- src/test/rustdoc/intra-doc-crate/submodule-outer.rs | 2 +- src/test/rustdoc/intra-doc-crate/traits.rs | 2 +- src/test/rustdoc/intra-doc-link-mod-ambiguity.rs | 2 +- src/test/rustdoc/intra-link-extern-crate.rs | 2 +- src/test/rustdoc/intra-link-in-bodies.rs | 2 +- src/test/rustdoc/intra-link-libstd-re-export.rs | 2 +- src/test/rustdoc/intra-link-prim-methods-external-core.rs | 2 +- src/test/rustdoc/intra-link-prim-methods-local.rs | 2 +- src/test/rustdoc/intra-link-prim-methods.rs | 2 +- src/test/rustdoc/intra-link-prim-precedence.rs | 2 +- src/test/rustdoc/intra-link-private.rs | 2 +- src/test/rustdoc/intra-link-proc-macro.rs | 2 +- src/test/rustdoc/intra-links-external-traits.rs | 2 +- src/test/rustdoc/through-proc-macro.rs | 2 +- 47 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index beb2556872df7..0766e7b87ea07 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -11,7 +11,7 @@ can use them like any other lints by doing this: Here is the list of the lints provided by `rustdoc`: -## intra_doc_link_resolution_failure +## intra_doc_link_resolution_failures This lint **warns by default** and is **nightly-only**. This lint detects when an intra-doc link fails to get resolved. For example: diff --git a/src/test/run-make-fulldeps/exit-code/lint-failure.rs b/src/test/run-make-fulldeps/exit-code/lint-failure.rs index 70bdddc6246bd..97c95a2672fc8 100644 --- a/src/test/run-make-fulldeps/exit-code/lint-failure.rs +++ b/src/test/run-make-fulldeps/exit-code/lint-failure.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] /// [intradoc::failure] pub fn main() { diff --git a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs index 9e64e6eb3999b..c443350031737 100644 --- a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs +++ b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] /// [v2] //~ ERROR pub fn foo() {} diff --git a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr index 894518faa3168..8263ffe9f4d82 100644 --- a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr +++ b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr @@ -7,7 +7,7 @@ LL | /// [v2] note: the lint level is defined here --> $DIR/deny-intra-link-resolution-failure.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failure)] +LL | #![deny(intra_doc_link_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.rs b/src/test/rustdoc-ui/intra-doc-alias-ice.rs index 9657d573d5016..aaf09a78093b6 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.rs +++ b/src/test/rustdoc-ui/intra-doc-alias-ice.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub type TypeAlias = usize; diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr index d2b2b90a4e50d..d692dc76d6af3 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr +++ b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr @@ -7,7 +7,7 @@ LL | /// [broken cross-reference](TypeAlias::hoge) note: the lint level is defined here --> $DIR/intra-doc-alias-ice.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failure)] +LL | #![deny(intra_doc_link_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs b/src/test/rustdoc-ui/intra-link-span-ice-55723.rs index 95388003f8470..89d271bb911a2 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] // An error in calculating spans while reporting intra-doc link resolution errors caused rustdoc to // attempt to slice in the middle of a multibyte character. See diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr index 156e214a79ff0..c0c49c027f624 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr @@ -7,7 +7,7 @@ LL | /// (arr[i]) note: the lint level is defined here --> $DIR/intra-link-span-ice-55723.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failure)] +LL | #![deny(intra_doc_link_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.rs b/src/test/rustdoc-ui/intra-links-ambiguity.rs index 7316fcdad6772..dd7b8eee384da 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.rs +++ b/src/test/rustdoc-ui/intra-links-ambiguity.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.stderr b/src/test/rustdoc-ui/intra-links-ambiguity.stderr index 7b9821b3d047a..a0c6dbd44b290 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.stderr +++ b/src/test/rustdoc-ui/intra-links-ambiguity.stderr @@ -7,7 +7,7 @@ LL | /// [`ambiguous`] is ambiguous. note: the lint level is defined here --> $DIR/intra-links-ambiguity.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failure)] +LL | #![deny(intra_doc_link_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to link to the struct, prefix with the item type | diff --git a/src/test/rustdoc-ui/intra-links-anchors.rs b/src/test/rustdoc-ui/intra-links-anchors.rs index 7e61bd725359a..fbf99fdba34b7 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.rs +++ b/src/test/rustdoc-ui/intra-links-anchors.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] // A few tests on anchors. diff --git a/src/test/rustdoc-ui/intra-links-anchors.stderr b/src/test/rustdoc-ui/intra-links-anchors.stderr index ef33d8f3e06fe..d7c47f1ed122a 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.stderr +++ b/src/test/rustdoc-ui/intra-links-anchors.stderr @@ -7,7 +7,7 @@ LL | /// Or maybe [Foo::f#hola]. note: the lint level is defined here --> $DIR/intra-links-anchors.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failure)] +LL | #![deny(intra_doc_link_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `hello#people#!` contains multiple anchors diff --git a/src/test/rustdoc-ui/intra-links-private.private.stderr b/src/test/rustdoc-ui/intra-links-private.private.stderr index a2148b82f819a..0cd3470851331 100644 --- a/src/test/rustdoc-ui/intra-links-private.private.stderr +++ b/src/test/rustdoc-ui/intra-links-private.private.stderr @@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_link_resolution_failure)]` on by default + = note: `#[warn(intra_doc_link_resolution_failures)]` on by default = note: this link resolves only because you passed `--document-private-items`, but will break without warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/intra-links-private.public.stderr b/src/test/rustdoc-ui/intra-links-private.public.stderr index 56742406992fc..dc09270a2e150 100644 --- a/src/test/rustdoc-ui/intra-links-private.public.stderr +++ b/src/test/rustdoc-ui/intra-links-private.public.stderr @@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_link_resolution_failure)]` on by default + = note: `#[warn(intra_doc_link_resolution_failures)]` on by default = note: this link will resolve properly if you pass `--document-private-items` warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr b/src/test/rustdoc-ui/intra-links-warning-crlf.stderr index bc31264c170ea..cc6f51ef15571 100644 --- a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr +++ b/src/test/rustdoc-ui/intra-links-warning-crlf.stderr @@ -4,7 +4,7 @@ warning: unresolved link to `error` LL | /// [error] | ^^^^^ unresolved link | - = note: `#[warn(intra_doc_link_resolution_failure)]` on by default + = note: `#[warn(intra_doc_link_resolution_failures)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error1` diff --git a/src/test/rustdoc-ui/intra-links-warning.stderr b/src/test/rustdoc-ui/intra-links-warning.stderr index 81931399c240a..28a92bd150b0b 100644 --- a/src/test/rustdoc-ui/intra-links-warning.stderr +++ b/src/test/rustdoc-ui/intra-links-warning.stderr @@ -4,7 +4,7 @@ warning: unresolved link to `Foo::baz` LL | //! Test with [Foo::baz], [Bar::foo], ... | ^^^^^^^^ unresolved link | - = note: `#[warn(intra_doc_link_resolution_failure)]` on by default + = note: `#[warn(intra_doc_link_resolution_failures)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `Bar::foo` diff --git a/src/test/rustdoc-ui/issue-74134.private.stderr b/src/test/rustdoc-ui/issue-74134.private.stderr index 9c5cdf0117cab..349d567dc3b2b 100644 --- a/src/test/rustdoc-ui/issue-74134.private.stderr +++ b/src/test/rustdoc-ui/issue-74134.private.stderr @@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy LL | /// [`PrivateType`] | ^^^^^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_link_resolution_failure)]` on by default + = note: `#[warn(intra_doc_link_resolution_failures)]` on by default = note: this link resolves only because you passed `--document-private-items`, but will break without warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/issue-74134.public.stderr b/src/test/rustdoc-ui/issue-74134.public.stderr index ff2951d864e64..6a73d4a32498d 100644 --- a/src/test/rustdoc-ui/issue-74134.public.stderr +++ b/src/test/rustdoc-ui/issue-74134.public.stderr @@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy LL | /// [`PrivateType`] | ^^^^^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_link_resolution_failure)]` on by default + = note: `#[warn(intra_doc_link_resolution_failures)]` on by default = note: this link will resolve properly if you pass `--document-private-items` warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/lint-group.stderr b/src/test/rustdoc-ui/lint-group.stderr index ad923c714da4d..203ca83884936 100644 --- a/src/test/rustdoc-ui/lint-group.stderr +++ b/src/test/rustdoc-ui/lint-group.stderr @@ -39,7 +39,7 @@ note: the lint level is defined here | LL | #![deny(rustdoc)] | ^^^^^^^ - = note: `#[deny(intra_doc_link_resolution_failure)]` implied by `#[deny(rustdoc)]` + = note: `#[deny(intra_doc_link_resolution_failures)]` implied by `#[deny(rustdoc)]` = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: aborting due to 3 previous errors diff --git a/src/test/rustdoc-ui/reference-link-has-one-warning.stderr b/src/test/rustdoc-ui/reference-link-has-one-warning.stderr index 5bbc62b76dd04..02b53eb710958 100644 --- a/src/test/rustdoc-ui/reference-link-has-one-warning.stderr +++ b/src/test/rustdoc-ui/reference-link-has-one-warning.stderr @@ -4,7 +4,7 @@ warning: `[with#anchor#error]` has an issue with the link anchor. LL | /// docs [label][with#anchor#error] | ^^^^^^^^^^^^^^^^^ only one `#` is allowed in a link | - = note: `#[warn(intra_doc_link_resolution_failure)]` on by default + = note: `#[warn(intra_doc_link_resolution_failures)]` on by default warning: 1 warning emitted diff --git a/src/test/rustdoc/intra-doc-crate/additional_doc.rs b/src/test/rustdoc/intra-doc-crate/additional_doc.rs index adfa7f5754eb9..f5ab6ce2101de 100644 --- a/src/test/rustdoc/intra-doc-crate/additional_doc.rs +++ b/src/test/rustdoc/intra-doc-crate/additional_doc.rs @@ -1,6 +1,6 @@ // aux-build:additional_doc.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] extern crate my_rand; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs index 8b8793e75ed59..59f59dc3919dd 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs @@ -1,5 +1,5 @@ #![crate_name = "my_rand"] -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub trait RngCore {} /// Rng extends [`RngCore`]. diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs index 23e38523a4f91..e4019dad3b6eb 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs @@ -1,5 +1,5 @@ #![crate_name = "hidden_dep"] -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] #[doc(hidden)] pub mod __reexport { diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs index 2ee5835a7df84..7ffb622a740c6 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs @@ -1,5 +1,5 @@ #![crate_name = "a"] -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub struct Foo; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs index abd41fec13016..9907f569e8b83 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs @@ -1,5 +1,5 @@ #![crate_name = "macro_inner"] -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub struct Foo; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs index 5d63d7e37b64d..a000cea07a28e 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs @@ -1,5 +1,5 @@ #![crate_name = "module_inner"] -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] /// [SomeType] links to [bar] pub struct SomeType; pub trait SomeTrait {} diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs index 3a22d13e673ac..e13e4b0ed2262 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs @@ -1,5 +1,5 @@ #![crate_name = "a"] -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub mod bar { pub struct Bar; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs index b8ca4e44e1f16..770ccc9ada88f 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs @@ -1,5 +1,5 @@ #![crate_name = "bar"] -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub trait Foo { /// [`Bar`] [`Baz`] diff --git a/src/test/rustdoc/intra-doc-crate/basic.rs b/src/test/rustdoc/intra-doc-crate/basic.rs index a245a0f84539c..db20ef296fa91 100644 --- a/src/test/rustdoc/intra-doc-crate/basic.rs +++ b/src/test/rustdoc/intra-doc-crate/basic.rs @@ -1,6 +1,6 @@ // aux-build:intra-doc-basic.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] // from https://github.com/rust-lang/rust/issues/65983 extern crate a; diff --git a/src/test/rustdoc/intra-doc-crate/hidden.rs b/src/test/rustdoc/intra-doc-crate/hidden.rs index e3d2af16db19c..45ca15f71d094 100644 --- a/src/test/rustdoc/intra-doc-crate/hidden.rs +++ b/src/test/rustdoc/intra-doc-crate/hidden.rs @@ -1,6 +1,6 @@ // aux-build:hidden.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] // tests https://github.com/rust-lang/rust/issues/73363 diff --git a/src/test/rustdoc/intra-doc-crate/macro.rs b/src/test/rustdoc/intra-doc-crate/macro.rs index 72fd57b6b0c7f..f219d99c681d2 100644 --- a/src/test/rustdoc/intra-doc-crate/macro.rs +++ b/src/test/rustdoc/intra-doc-crate/macro.rs @@ -2,7 +2,7 @@ // aux-build:macro_inner.rs // aux-build:proc_macro.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] extern crate macro_inner; extern crate proc_macro_inner; diff --git a/src/test/rustdoc/intra-doc-crate/module.rs b/src/test/rustdoc/intra-doc-crate/module.rs index 67fa7293f37fb..658b3219681ef 100644 --- a/src/test/rustdoc/intra-doc-crate/module.rs +++ b/src/test/rustdoc/intra-doc-crate/module.rs @@ -1,7 +1,7 @@ // outer.rs // aux-build: module.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] extern crate module_inner; // @has 'module/bar/index.html' '//a[@href="../../module_inner/trait.SomeTrait.html"]' 'SomeTrait' // @has 'module/bar/index.html' '//a[@href="../../module_inner/struct.SomeType.html"]' 'SomeType' diff --git a/src/test/rustdoc/intra-doc-crate/submodule-inner.rs b/src/test/rustdoc/intra-doc-crate/submodule-inner.rs index b4b615bf9edad..166dc073fe346 100644 --- a/src/test/rustdoc/intra-doc-crate/submodule-inner.rs +++ b/src/test/rustdoc/intra-doc-crate/submodule-inner.rs @@ -1,6 +1,6 @@ // aux-build:submodule-inner.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] extern crate a; diff --git a/src/test/rustdoc/intra-doc-crate/submodule-outer.rs b/src/test/rustdoc/intra-doc-crate/submodule-outer.rs index 6b30ef8b3dec8..f849cc25531ab 100644 --- a/src/test/rustdoc/intra-doc-crate/submodule-outer.rs +++ b/src/test/rustdoc/intra-doc-crate/submodule-outer.rs @@ -1,6 +1,6 @@ // aux-build:submodule-outer.rs // edition:2018 -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] extern crate bar as bar_; diff --git a/src/test/rustdoc/intra-doc-crate/traits.rs b/src/test/rustdoc/intra-doc-crate/traits.rs index 617331236902d..8a3b20d175b20 100644 --- a/src/test/rustdoc/intra-doc-crate/traits.rs +++ b/src/test/rustdoc/intra-doc-crate/traits.rs @@ -3,7 +3,7 @@ // aux-build:traits.rs // build-aux-docs // ignore-tidy-line-length -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] extern crate inner; use inner::SomeTrait; diff --git a/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs b/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs index 65187f48539a4..b64817662b60b 100644 --- a/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs +++ b/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs @@ -1,6 +1,6 @@ // ignore-tidy-linelength -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub fn foo() { diff --git a/src/test/rustdoc/intra-link-extern-crate.rs b/src/test/rustdoc/intra-link-extern-crate.rs index bbe3edaea8cb2..8066d57e571e7 100644 --- a/src/test/rustdoc/intra-link-extern-crate.rs +++ b/src/test/rustdoc/intra-link-extern-crate.rs @@ -4,6 +4,6 @@ // though they would never actually get displayed. This tripped intra-doc-link resolution failures, // for items that aren't under our control, and not actually getting documented! -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] extern crate inner; diff --git a/src/test/rustdoc/intra-link-in-bodies.rs b/src/test/rustdoc/intra-link-in-bodies.rs index 4c693907226ad..4f299dec996c4 100644 --- a/src/test/rustdoc/intra-link-in-bodies.rs +++ b/src/test/rustdoc/intra-link-in-bodies.rs @@ -1,6 +1,6 @@ // we need to make sure that intra-doc links on trait impls get resolved in the right scope -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub mod inner { pub struct SomethingOutOfScope; diff --git a/src/test/rustdoc/intra-link-libstd-re-export.rs b/src/test/rustdoc/intra-link-libstd-re-export.rs index 6f239292ec200..95c3a33bfb19a 100644 --- a/src/test/rustdoc/intra-link-libstd-re-export.rs +++ b/src/test/rustdoc/intra-link-libstd-re-export.rs @@ -1,3 +1,3 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub use std::*; diff --git a/src/test/rustdoc/intra-link-prim-methods-external-core.rs b/src/test/rustdoc/intra-link-prim-methods-external-core.rs index e09d36594edf9..6205a10b6709d 100644 --- a/src/test/rustdoc/intra-link-prim-methods-external-core.rs +++ b/src/test/rustdoc/intra-link-prim-methods-external-core.rs @@ -4,7 +4,7 @@ // ignore-windows // ignore-tidy-linelength -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] #![feature(no_core, lang_items)] #![no_core] #![crate_type = "rlib"] diff --git a/src/test/rustdoc/intra-link-prim-methods-local.rs b/src/test/rustdoc/intra-link-prim-methods-local.rs index d24cd2cbb5e20..6f9712edb1925 100644 --- a/src/test/rustdoc/intra-link-prim-methods-local.rs +++ b/src/test/rustdoc/intra-link-prim-methods-local.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] #![feature(no_core, lang_items)] #![no_core] #![crate_type = "rlib"] diff --git a/src/test/rustdoc/intra-link-prim-methods.rs b/src/test/rustdoc/intra-link-prim-methods.rs index 76636b80b5eb5..770e0e99d8b62 100644 --- a/src/test/rustdoc/intra-link-prim-methods.rs +++ b/src/test/rustdoc/intra-link-prim-methods.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] // ignore-tidy-linelength diff --git a/src/test/rustdoc/intra-link-prim-precedence.rs b/src/test/rustdoc/intra-link-prim-precedence.rs index d7ebb73b3be7d..c149e15c81c0c 100644 --- a/src/test/rustdoc/intra-link-prim-precedence.rs +++ b/src/test/rustdoc/intra-link-prim-precedence.rs @@ -1,5 +1,5 @@ // ignore-tidy-linelength -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] pub mod char {} diff --git a/src/test/rustdoc/intra-link-private.rs b/src/test/rustdoc/intra-link-private.rs index c99b4d70684aa..24a9fda034157 100644 --- a/src/test/rustdoc/intra-link-private.rs +++ b/src/test/rustdoc/intra-link-private.rs @@ -2,7 +2,7 @@ // These failures were legitimate, but not truly relevant - the docs in question couldn't be // checked for accuracy anyway. -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] /// ooh, i'm a [rebel] just for kicks struct SomeStruct; diff --git a/src/test/rustdoc/intra-link-proc-macro.rs b/src/test/rustdoc/intra-link-proc-macro.rs index 7b6ea5d60f853..d22a4cfbf389d 100644 --- a/src/test/rustdoc/intra-link-proc-macro.rs +++ b/src/test/rustdoc/intra-link-proc-macro.rs @@ -1,6 +1,6 @@ // aux-build:intra-link-proc-macro-macro.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] extern crate intra_link_proc_macro_macro; diff --git a/src/test/rustdoc/intra-links-external-traits.rs b/src/test/rustdoc/intra-links-external-traits.rs index d6b4a8ad58ad7..dd6f0e780f948 100644 --- a/src/test/rustdoc/intra-links-external-traits.rs +++ b/src/test/rustdoc/intra-links-external-traits.rs @@ -2,7 +2,7 @@ // ignore-cross-compile #![crate_name = "outer"] -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_link_resolution_failures)] // using a trait that has intra-doc links on it from another crate (whether re-exporting or just // implementing it) used to give spurious resolution failure warnings diff --git a/src/test/rustdoc/through-proc-macro.rs b/src/test/rustdoc/through-proc-macro.rs index 348c9eea2dcbf..6c650146df130 100644 --- a/src/test/rustdoc/through-proc-macro.rs +++ b/src/test/rustdoc/through-proc-macro.rs @@ -1,6 +1,6 @@ // aux-build:through-proc-macro-aux.rs // build-aux-docs -#![warn(intra_doc_link_resolution_failure)] +#![warn(intra_doc_link_resolution_failures)] extern crate some_macros; #[some_macros::second] From da0b10c4fb2ff230fd68e3096c467da5dd82e89e Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 29 Jul 2020 15:23:07 -0700 Subject: [PATCH 03/10] Register renamed lint --- src/librustc_lint/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index ee5ea6a9a192e..4fb47a7363d8a 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -318,6 +318,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) { store.register_renamed("async_idents", "keyword_idents"); store.register_renamed("exceeding_bitshifts", "arithmetic_overflow"); store.register_renamed("redundant_semicolon", "redundant_semicolons"); + store.register_renamed("intra_doc_link_resolution_failure", "intra_doc_link_resolution_failures"); store.register_removed("unknown_features", "replaced by an error"); store.register_removed("unsigned_negation", "replaced by negate_unsigned feature gate"); store.register_removed("negate_unsigned", "cast a signed value instead"); From 4df76f0f90fc0aa4cb3ed4c2c812c6f505f3e21e Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 29 Jul 2020 16:26:32 -0700 Subject: [PATCH 04/10] Rename to intra_doc_resolution_failures --- src/doc/rustdoc/src/lints.md | 2 +- src/librustc_lint/lib.rs | 6 +- src/librustc_session/lint/builtin.rs | 4 +- src/librustdoc/core.rs | 2 +- .../passes/collect_intra_doc_links.rs | 66 +++++++++---------- .../exit-code/lint-failure.rs | 2 +- .../deny-intra-link-resolution-failure.rs | 2 +- .../deny-intra-link-resolution-failure.stderr | 2 +- src/test/rustdoc-ui/intra-doc-alias-ice.rs | 2 +- .../rustdoc-ui/intra-doc-alias-ice.stderr | 2 +- .../rustdoc-ui/intra-link-span-ice-55723.rs | 2 +- .../intra-link-span-ice-55723.stderr | 2 +- src/test/rustdoc-ui/intra-links-ambiguity.rs | 2 +- .../rustdoc-ui/intra-links-ambiguity.stderr | 2 +- src/test/rustdoc-ui/intra-links-anchors.rs | 2 +- .../rustdoc-ui/intra-links-anchors.stderr | 2 +- .../intra-links-private.private.stderr | 2 +- .../intra-links-private.public.stderr | 2 +- .../intra-links-warning-crlf.stderr | 2 +- .../rustdoc-ui/intra-links-warning.stderr | 2 +- .../rustdoc-ui/issue-74134.private.stderr | 2 +- src/test/rustdoc-ui/issue-74134.public.stderr | 2 +- src/test/rustdoc-ui/lint-group.stderr | 2 +- .../reference-link-has-one-warning.stderr | 2 +- .../rustdoc/intra-doc-crate/additional_doc.rs | 2 +- .../auxiliary/additional_doc.rs | 2 +- .../intra-doc-crate/auxiliary/hidden.rs | 2 +- .../auxiliary/intra-doc-basic.rs | 2 +- .../intra-doc-crate/auxiliary/macro_inner.rs | 2 +- .../intra-doc-crate/auxiliary/module.rs | 2 +- .../auxiliary/submodule-inner.rs | 2 +- .../auxiliary/submodule-outer.rs | 2 +- src/test/rustdoc/intra-doc-crate/basic.rs | 2 +- src/test/rustdoc/intra-doc-crate/hidden.rs | 2 +- src/test/rustdoc/intra-doc-crate/macro.rs | 2 +- src/test/rustdoc/intra-doc-crate/module.rs | 2 +- .../intra-doc-crate/submodule-inner.rs | 2 +- .../intra-doc-crate/submodule-outer.rs | 2 +- src/test/rustdoc/intra-doc-crate/traits.rs | 2 +- .../rustdoc/intra-doc-link-mod-ambiguity.rs | 2 +- src/test/rustdoc/intra-link-extern-crate.rs | 2 +- src/test/rustdoc/intra-link-in-bodies.rs | 2 +- .../rustdoc/intra-link-libstd-re-export.rs | 2 +- .../intra-link-prim-methods-external-core.rs | 2 +- .../rustdoc/intra-link-prim-methods-local.rs | 2 +- src/test/rustdoc/intra-link-prim-methods.rs | 2 +- .../rustdoc/intra-link-prim-precedence.rs | 2 +- src/test/rustdoc/intra-link-private.rs | 2 +- src/test/rustdoc/intra-link-proc-macro.rs | 2 +- .../rustdoc/intra-links-external-traits.rs | 2 +- src/test/rustdoc/through-proc-macro.rs | 2 +- 51 files changed, 83 insertions(+), 89 deletions(-) diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index 0766e7b87ea07..275cadb65252b 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -11,7 +11,7 @@ can use them like any other lints by doing this: Here is the list of the lints provided by `rustdoc`: -## intra_doc_link_resolution_failures +## intra_doc_resolution_failures This lint **warns by default** and is **nightly-only**. This lint detects when an intra-doc link fails to get resolved. For example: diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 4fb47a7363d8a..a542f5c96fa7e 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -62,7 +62,7 @@ use rustc_middle::ty::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_session::lint::builtin::{ BARE_TRAIT_OBJECTS, ELIDED_LIFETIMES_IN_PATHS, EXPLICIT_OUTLIVES_REQUIREMENTS, - INTRA_DOC_LINK_RESOLUTION_FAILURES, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, + INTRA_DOC_RESOLUTION_FAILURES, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS, }; use rustc_span::symbol::{Ident, Symbol}; @@ -303,7 +303,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) { add_lint_group!( "rustdoc", - INTRA_DOC_LINK_RESOLUTION_FAILURES, + INTRA_DOC_RESOLUTION_FAILURES, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS @@ -318,7 +318,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) { store.register_renamed("async_idents", "keyword_idents"); store.register_renamed("exceeding_bitshifts", "arithmetic_overflow"); store.register_renamed("redundant_semicolon", "redundant_semicolons"); - store.register_renamed("intra_doc_link_resolution_failure", "intra_doc_link_resolution_failures"); + store.register_renamed("intra_doc_link_resolution_failure", "intra_doc_resolution_failures"); store.register_removed("unknown_features", "replaced by an error"); store.register_removed("unsigned_negation", "replaced by negate_unsigned feature gate"); store.register_removed("negate_unsigned", "cast a signed value instead"); diff --git a/src/librustc_session/lint/builtin.rs b/src/librustc_session/lint/builtin.rs index 3e93c430c1f53..f2a5289c8c445 100644 --- a/src/librustc_session/lint/builtin.rs +++ b/src/librustc_session/lint/builtin.rs @@ -398,7 +398,7 @@ declare_lint! { } declare_lint! { - pub INTRA_DOC_LINK_RESOLUTION_FAILURES, + pub INTRA_DOC_RESOLUTION_FAILURES, Warn, "failures in resolving intra-doc link targets" } @@ -601,7 +601,7 @@ declare_lint_pass! { ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE, UNSTABLE_NAME_COLLISIONS, IRREFUTABLE_LET_PATTERNS, - INTRA_DOC_LINK_RESOLUTION_FAILURES, + INTRA_DOC_RESOLUTION_FAILURES, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_CRATE_LEVEL_DOCS, MISSING_DOC_CODE_EXAMPLES, diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index ecd6a28bcecf9..35c340bf251d9 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -315,7 +315,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt let cpath = Some(input.clone()); let input = Input::File(input); - let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURES.name; + let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_RESOLUTION_FAILURES.name; let missing_docs = rustc_lint::builtin::MISSING_DOCS.name; let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name; let private_doc_tests = rustc_lint::builtin::PRIVATE_DOC_TESTS.name; diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index c65905ade31f1..02a9483f9293a 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -867,46 +867,40 @@ fn report_diagnostic( let attrs = &item.attrs; let sp = span_of_attrs(attrs).unwrap_or(item.source.span()); - cx.tcx.struct_span_lint_hir( - lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURES, - hir_id, - sp, - |lint| { - let mut diag = lint.build(msg); - - let span = link_range - .as_ref() - .and_then(|range| super::source_span_for_markdown_range(cx, dox, range, attrs)); - - if let Some(link_range) = link_range { - if let Some(sp) = span { - diag.set_span(sp); - } else { - // blah blah blah\nblah\nblah [blah] blah blah\nblah blah - // ^ ~~~~ - // | link_range - // last_new_line_offset - let last_new_line_offset = - dox[..link_range.start].rfind('\n').map_or(0, |n| n + 1); - let line = dox[last_new_line_offset..].lines().next().unwrap_or(""); - - // Print the line containing the `link_range` and manually mark it with '^'s. - diag.note(&format!( - "the link appears in this line:\n\n{line}\n\ + cx.tcx.struct_span_lint_hir(lint::builtin::INTRA_DOC_RESOLUTION_FAILURES, hir_id, sp, |lint| { + let mut diag = lint.build(msg); + + let span = link_range + .as_ref() + .and_then(|range| super::source_span_for_markdown_range(cx, dox, range, attrs)); + + if let Some(link_range) = link_range { + if let Some(sp) = span { + diag.set_span(sp); + } else { + // blah blah blah\nblah\nblah [blah] blah blah\nblah blah + // ^ ~~~~ + // | link_range + // last_new_line_offset + let last_new_line_offset = dox[..link_range.start].rfind('\n').map_or(0, |n| n + 1); + let line = dox[last_new_line_offset..].lines().next().unwrap_or(""); + + // Print the line containing the `link_range` and manually mark it with '^'s. + diag.note(&format!( + "the link appears in this line:\n\n{line}\n\ {indicator: $DIR/deny-intra-link-resolution-failure.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failures)] +LL | #![deny(intra_doc_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.rs b/src/test/rustdoc-ui/intra-doc-alias-ice.rs index aaf09a78093b6..5729ebb4cc017 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.rs +++ b/src/test/rustdoc-ui/intra-doc-alias-ice.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub type TypeAlias = usize; diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr index d692dc76d6af3..5ba34dd1d54af 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr +++ b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr @@ -7,7 +7,7 @@ LL | /// [broken cross-reference](TypeAlias::hoge) note: the lint level is defined here --> $DIR/intra-doc-alias-ice.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failures)] +LL | #![deny(intra_doc_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs b/src/test/rustdoc-ui/intra-link-span-ice-55723.rs index 89d271bb911a2..efd492406342a 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] // An error in calculating spans while reporting intra-doc link resolution errors caused rustdoc to // attempt to slice in the middle of a multibyte character. See diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr index c0c49c027f624..5c0ab62c6a13b 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr @@ -7,7 +7,7 @@ LL | /// (arr[i]) note: the lint level is defined here --> $DIR/intra-link-span-ice-55723.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failures)] +LL | #![deny(intra_doc_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.rs b/src/test/rustdoc-ui/intra-links-ambiguity.rs index dd7b8eee384da..7b2ca4f48d57b 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.rs +++ b/src/test/rustdoc-ui/intra-links-ambiguity.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.stderr b/src/test/rustdoc-ui/intra-links-ambiguity.stderr index a0c6dbd44b290..94b9258bdeeac 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.stderr +++ b/src/test/rustdoc-ui/intra-links-ambiguity.stderr @@ -7,7 +7,7 @@ LL | /// [`ambiguous`] is ambiguous. note: the lint level is defined here --> $DIR/intra-links-ambiguity.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failures)] +LL | #![deny(intra_doc_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to link to the struct, prefix with the item type | diff --git a/src/test/rustdoc-ui/intra-links-anchors.rs b/src/test/rustdoc-ui/intra-links-anchors.rs index fbf99fdba34b7..24e3bf1832aef 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.rs +++ b/src/test/rustdoc-ui/intra-links-anchors.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] // A few tests on anchors. diff --git a/src/test/rustdoc-ui/intra-links-anchors.stderr b/src/test/rustdoc-ui/intra-links-anchors.stderr index d7c47f1ed122a..29a632273fa73 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.stderr +++ b/src/test/rustdoc-ui/intra-links-anchors.stderr @@ -7,7 +7,7 @@ LL | /// Or maybe [Foo::f#hola]. note: the lint level is defined here --> $DIR/intra-links-anchors.rs:1:9 | -LL | #![deny(intra_doc_link_resolution_failures)] +LL | #![deny(intra_doc_resolution_failures)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `hello#people#!` contains multiple anchors diff --git a/src/test/rustdoc-ui/intra-links-private.private.stderr b/src/test/rustdoc-ui/intra-links-private.private.stderr index 0cd3470851331..5c40fcd826b10 100644 --- a/src/test/rustdoc-ui/intra-links-private.private.stderr +++ b/src/test/rustdoc-ui/intra-links-private.private.stderr @@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_link_resolution_failures)]` on by default + = note: `#[warn(intra_doc_resolution_failures)]` on by default = note: this link resolves only because you passed `--document-private-items`, but will break without warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/intra-links-private.public.stderr b/src/test/rustdoc-ui/intra-links-private.public.stderr index dc09270a2e150..93ba3229038b8 100644 --- a/src/test/rustdoc-ui/intra-links-private.public.stderr +++ b/src/test/rustdoc-ui/intra-links-private.public.stderr @@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_link_resolution_failures)]` on by default + = note: `#[warn(intra_doc_resolution_failures)]` on by default = note: this link will resolve properly if you pass `--document-private-items` warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr b/src/test/rustdoc-ui/intra-links-warning-crlf.stderr index cc6f51ef15571..0cf440c1fad2f 100644 --- a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr +++ b/src/test/rustdoc-ui/intra-links-warning-crlf.stderr @@ -4,7 +4,7 @@ warning: unresolved link to `error` LL | /// [error] | ^^^^^ unresolved link | - = note: `#[warn(intra_doc_link_resolution_failures)]` on by default + = note: `#[warn(intra_doc_resolution_failures)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error1` diff --git a/src/test/rustdoc-ui/intra-links-warning.stderr b/src/test/rustdoc-ui/intra-links-warning.stderr index 28a92bd150b0b..c0091cefb4f33 100644 --- a/src/test/rustdoc-ui/intra-links-warning.stderr +++ b/src/test/rustdoc-ui/intra-links-warning.stderr @@ -4,7 +4,7 @@ warning: unresolved link to `Foo::baz` LL | //! Test with [Foo::baz], [Bar::foo], ... | ^^^^^^^^ unresolved link | - = note: `#[warn(intra_doc_link_resolution_failures)]` on by default + = note: `#[warn(intra_doc_resolution_failures)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `Bar::foo` diff --git a/src/test/rustdoc-ui/issue-74134.private.stderr b/src/test/rustdoc-ui/issue-74134.private.stderr index 349d567dc3b2b..16d7c27230c2d 100644 --- a/src/test/rustdoc-ui/issue-74134.private.stderr +++ b/src/test/rustdoc-ui/issue-74134.private.stderr @@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy LL | /// [`PrivateType`] | ^^^^^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_link_resolution_failures)]` on by default + = note: `#[warn(intra_doc_resolution_failures)]` on by default = note: this link resolves only because you passed `--document-private-items`, but will break without warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/issue-74134.public.stderr b/src/test/rustdoc-ui/issue-74134.public.stderr index 6a73d4a32498d..a9ca83f810ad1 100644 --- a/src/test/rustdoc-ui/issue-74134.public.stderr +++ b/src/test/rustdoc-ui/issue-74134.public.stderr @@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy LL | /// [`PrivateType`] | ^^^^^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_link_resolution_failures)]` on by default + = note: `#[warn(intra_doc_resolution_failures)]` on by default = note: this link will resolve properly if you pass `--document-private-items` warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/lint-group.stderr b/src/test/rustdoc-ui/lint-group.stderr index 203ca83884936..471bb71fe5d8c 100644 --- a/src/test/rustdoc-ui/lint-group.stderr +++ b/src/test/rustdoc-ui/lint-group.stderr @@ -39,7 +39,7 @@ note: the lint level is defined here | LL | #![deny(rustdoc)] | ^^^^^^^ - = note: `#[deny(intra_doc_link_resolution_failures)]` implied by `#[deny(rustdoc)]` + = note: `#[deny(intra_doc_resolution_failures)]` implied by `#[deny(rustdoc)]` = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: aborting due to 3 previous errors diff --git a/src/test/rustdoc-ui/reference-link-has-one-warning.stderr b/src/test/rustdoc-ui/reference-link-has-one-warning.stderr index 02b53eb710958..e5276a2b4aa84 100644 --- a/src/test/rustdoc-ui/reference-link-has-one-warning.stderr +++ b/src/test/rustdoc-ui/reference-link-has-one-warning.stderr @@ -4,7 +4,7 @@ warning: `[with#anchor#error]` has an issue with the link anchor. LL | /// docs [label][with#anchor#error] | ^^^^^^^^^^^^^^^^^ only one `#` is allowed in a link | - = note: `#[warn(intra_doc_link_resolution_failures)]` on by default + = note: `#[warn(intra_doc_resolution_failures)]` on by default warning: 1 warning emitted diff --git a/src/test/rustdoc/intra-doc-crate/additional_doc.rs b/src/test/rustdoc/intra-doc-crate/additional_doc.rs index f5ab6ce2101de..ca30895e3ce2d 100644 --- a/src/test/rustdoc/intra-doc-crate/additional_doc.rs +++ b/src/test/rustdoc/intra-doc-crate/additional_doc.rs @@ -1,6 +1,6 @@ // aux-build:additional_doc.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] extern crate my_rand; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs index 59f59dc3919dd..b0f6dda865b63 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs @@ -1,5 +1,5 @@ #![crate_name = "my_rand"] -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub trait RngCore {} /// Rng extends [`RngCore`]. diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs index e4019dad3b6eb..f2bc8f470b87f 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs @@ -1,5 +1,5 @@ #![crate_name = "hidden_dep"] -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] #[doc(hidden)] pub mod __reexport { diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs index 7ffb622a740c6..a98fec734d70e 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs @@ -1,5 +1,5 @@ #![crate_name = "a"] -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub struct Foo; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs index 9907f569e8b83..59c4d7e00702c 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs @@ -1,5 +1,5 @@ #![crate_name = "macro_inner"] -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub struct Foo; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs index a000cea07a28e..2dc70211262f5 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs @@ -1,5 +1,5 @@ #![crate_name = "module_inner"] -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] /// [SomeType] links to [bar] pub struct SomeType; pub trait SomeTrait {} diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs index e13e4b0ed2262..d79a1b1b12e65 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs @@ -1,5 +1,5 @@ #![crate_name = "a"] -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub mod bar { pub struct Bar; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs index 770ccc9ada88f..e1f0bd9c6dd56 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs @@ -1,5 +1,5 @@ #![crate_name = "bar"] -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub trait Foo { /// [`Bar`] [`Baz`] diff --git a/src/test/rustdoc/intra-doc-crate/basic.rs b/src/test/rustdoc/intra-doc-crate/basic.rs index db20ef296fa91..88b18ed539bd2 100644 --- a/src/test/rustdoc/intra-doc-crate/basic.rs +++ b/src/test/rustdoc/intra-doc-crate/basic.rs @@ -1,6 +1,6 @@ // aux-build:intra-doc-basic.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] // from https://github.com/rust-lang/rust/issues/65983 extern crate a; diff --git a/src/test/rustdoc/intra-doc-crate/hidden.rs b/src/test/rustdoc/intra-doc-crate/hidden.rs index 45ca15f71d094..6d832b5a5f7ea 100644 --- a/src/test/rustdoc/intra-doc-crate/hidden.rs +++ b/src/test/rustdoc/intra-doc-crate/hidden.rs @@ -1,6 +1,6 @@ // aux-build:hidden.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] // tests https://github.com/rust-lang/rust/issues/73363 diff --git a/src/test/rustdoc/intra-doc-crate/macro.rs b/src/test/rustdoc/intra-doc-crate/macro.rs index f219d99c681d2..dd5dbec144da2 100644 --- a/src/test/rustdoc/intra-doc-crate/macro.rs +++ b/src/test/rustdoc/intra-doc-crate/macro.rs @@ -2,7 +2,7 @@ // aux-build:macro_inner.rs // aux-build:proc_macro.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] extern crate macro_inner; extern crate proc_macro_inner; diff --git a/src/test/rustdoc/intra-doc-crate/module.rs b/src/test/rustdoc/intra-doc-crate/module.rs index 658b3219681ef..0a6cc27f4a045 100644 --- a/src/test/rustdoc/intra-doc-crate/module.rs +++ b/src/test/rustdoc/intra-doc-crate/module.rs @@ -1,7 +1,7 @@ // outer.rs // aux-build: module.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] extern crate module_inner; // @has 'module/bar/index.html' '//a[@href="../../module_inner/trait.SomeTrait.html"]' 'SomeTrait' // @has 'module/bar/index.html' '//a[@href="../../module_inner/struct.SomeType.html"]' 'SomeType' diff --git a/src/test/rustdoc/intra-doc-crate/submodule-inner.rs b/src/test/rustdoc/intra-doc-crate/submodule-inner.rs index 166dc073fe346..f86547f90e112 100644 --- a/src/test/rustdoc/intra-doc-crate/submodule-inner.rs +++ b/src/test/rustdoc/intra-doc-crate/submodule-inner.rs @@ -1,6 +1,6 @@ // aux-build:submodule-inner.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] extern crate a; diff --git a/src/test/rustdoc/intra-doc-crate/submodule-outer.rs b/src/test/rustdoc/intra-doc-crate/submodule-outer.rs index f849cc25531ab..62781da479ffb 100644 --- a/src/test/rustdoc/intra-doc-crate/submodule-outer.rs +++ b/src/test/rustdoc/intra-doc-crate/submodule-outer.rs @@ -1,6 +1,6 @@ // aux-build:submodule-outer.rs // edition:2018 -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] extern crate bar as bar_; diff --git a/src/test/rustdoc/intra-doc-crate/traits.rs b/src/test/rustdoc/intra-doc-crate/traits.rs index 8a3b20d175b20..f12ba5b21fc36 100644 --- a/src/test/rustdoc/intra-doc-crate/traits.rs +++ b/src/test/rustdoc/intra-doc-crate/traits.rs @@ -3,7 +3,7 @@ // aux-build:traits.rs // build-aux-docs // ignore-tidy-line-length -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] extern crate inner; use inner::SomeTrait; diff --git a/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs b/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs index b64817662b60b..38fa3d0c7dbac 100644 --- a/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs +++ b/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs @@ -1,6 +1,6 @@ // ignore-tidy-linelength -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub fn foo() { diff --git a/src/test/rustdoc/intra-link-extern-crate.rs b/src/test/rustdoc/intra-link-extern-crate.rs index 8066d57e571e7..2af6880c6328e 100644 --- a/src/test/rustdoc/intra-link-extern-crate.rs +++ b/src/test/rustdoc/intra-link-extern-crate.rs @@ -4,6 +4,6 @@ // though they would never actually get displayed. This tripped intra-doc-link resolution failures, // for items that aren't under our control, and not actually getting documented! -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] extern crate inner; diff --git a/src/test/rustdoc/intra-link-in-bodies.rs b/src/test/rustdoc/intra-link-in-bodies.rs index 4f299dec996c4..48244aa2ac792 100644 --- a/src/test/rustdoc/intra-link-in-bodies.rs +++ b/src/test/rustdoc/intra-link-in-bodies.rs @@ -1,6 +1,6 @@ // we need to make sure that intra-doc links on trait impls get resolved in the right scope -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub mod inner { pub struct SomethingOutOfScope; diff --git a/src/test/rustdoc/intra-link-libstd-re-export.rs b/src/test/rustdoc/intra-link-libstd-re-export.rs index 95c3a33bfb19a..07623da50171d 100644 --- a/src/test/rustdoc/intra-link-libstd-re-export.rs +++ b/src/test/rustdoc/intra-link-libstd-re-export.rs @@ -1,3 +1,3 @@ -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub use std::*; diff --git a/src/test/rustdoc/intra-link-prim-methods-external-core.rs b/src/test/rustdoc/intra-link-prim-methods-external-core.rs index 6205a10b6709d..8166489c7a62b 100644 --- a/src/test/rustdoc/intra-link-prim-methods-external-core.rs +++ b/src/test/rustdoc/intra-link-prim-methods-external-core.rs @@ -4,7 +4,7 @@ // ignore-windows // ignore-tidy-linelength -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] #![feature(no_core, lang_items)] #![no_core] #![crate_type = "rlib"] diff --git a/src/test/rustdoc/intra-link-prim-methods-local.rs b/src/test/rustdoc/intra-link-prim-methods-local.rs index 6f9712edb1925..c42c6986233c5 100644 --- a/src/test/rustdoc/intra-link-prim-methods-local.rs +++ b/src/test/rustdoc/intra-link-prim-methods-local.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] #![feature(no_core, lang_items)] #![no_core] #![crate_type = "rlib"] diff --git a/src/test/rustdoc/intra-link-prim-methods.rs b/src/test/rustdoc/intra-link-prim-methods.rs index 770e0e99d8b62..bfb974d95b365 100644 --- a/src/test/rustdoc/intra-link-prim-methods.rs +++ b/src/test/rustdoc/intra-link-prim-methods.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] // ignore-tidy-linelength diff --git a/src/test/rustdoc/intra-link-prim-precedence.rs b/src/test/rustdoc/intra-link-prim-precedence.rs index c149e15c81c0c..ee0ef743a1e93 100644 --- a/src/test/rustdoc/intra-link-prim-precedence.rs +++ b/src/test/rustdoc/intra-link-prim-precedence.rs @@ -1,5 +1,5 @@ // ignore-tidy-linelength -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] pub mod char {} diff --git a/src/test/rustdoc/intra-link-private.rs b/src/test/rustdoc/intra-link-private.rs index 24a9fda034157..08a2a8070cb86 100644 --- a/src/test/rustdoc/intra-link-private.rs +++ b/src/test/rustdoc/intra-link-private.rs @@ -2,7 +2,7 @@ // These failures were legitimate, but not truly relevant - the docs in question couldn't be // checked for accuracy anyway. -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] /// ooh, i'm a [rebel] just for kicks struct SomeStruct; diff --git a/src/test/rustdoc/intra-link-proc-macro.rs b/src/test/rustdoc/intra-link-proc-macro.rs index d22a4cfbf389d..eef82c4ac192c 100644 --- a/src/test/rustdoc/intra-link-proc-macro.rs +++ b/src/test/rustdoc/intra-link-proc-macro.rs @@ -1,6 +1,6 @@ // aux-build:intra-link-proc-macro-macro.rs // build-aux-docs -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] extern crate intra_link_proc_macro_macro; diff --git a/src/test/rustdoc/intra-links-external-traits.rs b/src/test/rustdoc/intra-links-external-traits.rs index dd6f0e780f948..de00f787bd292 100644 --- a/src/test/rustdoc/intra-links-external-traits.rs +++ b/src/test/rustdoc/intra-links-external-traits.rs @@ -2,7 +2,7 @@ // ignore-cross-compile #![crate_name = "outer"] -#![deny(intra_doc_link_resolution_failures)] +#![deny(intra_doc_resolution_failures)] // using a trait that has intra-doc links on it from another crate (whether re-exporting or just // implementing it) used to give spurious resolution failure warnings diff --git a/src/test/rustdoc/through-proc-macro.rs b/src/test/rustdoc/through-proc-macro.rs index 6c650146df130..fb84ef614744c 100644 --- a/src/test/rustdoc/through-proc-macro.rs +++ b/src/test/rustdoc/through-proc-macro.rs @@ -1,6 +1,6 @@ // aux-build:through-proc-macro-aux.rs // build-aux-docs -#![warn(intra_doc_link_resolution_failures)] +#![warn(intra_doc_resolution_failures)] extern crate some_macros; #[some_macros::second] From 7b7b5a7a129a640e4c652fbe91dd4113b0b5e06c Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 29 Jul 2020 17:06:44 -0700 Subject: [PATCH 05/10] Rename in library --- library/alloc/src/lib.rs | 2 +- library/core/src/lib.rs | 4 ++-- library/std/src/lib.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index 90e2d2531c552..479e0a955090f 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -69,7 +69,7 @@ #![warn(deprecated_in_future)] #![warn(missing_docs)] #![warn(missing_debug_implementations)] -#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings +#![deny(intra_doc_resolution_failures)] // rustdoc is run without -D warnings #![allow(explicit_outlives_requirements)] #![allow(incomplete_features)] #![deny(unsafe_op_in_unsafe_fn)] diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index c2bd5d16088fd..7c9dd92ffa0ee 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -61,7 +61,7 @@ #![warn(deprecated_in_future)] #![warn(missing_docs)] #![warn(missing_debug_implementations)] -#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings +#![deny(intra_doc_resolution_failures)] // rustdoc is run without -D warnings #![allow(explicit_outlives_requirements)] #![allow(incomplete_features)] #![feature(allow_internal_unstable)] @@ -149,7 +149,7 @@ #![feature(slice_ptr_get)] #![feature(no_niche)] // rust-lang/rust#68303 #![feature(unsafe_block_in_unsafe_fn)] -#![deny(intra_doc_link_resolution_failure)] +#![deny(intra_doc_resolution_failures)] #![deny(unsafe_op_in_unsafe_fn)] #[prelude_import] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index c6e5b0a492ac8..edd677b2ae086 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -212,7 +212,7 @@ #![warn(deprecated_in_future)] #![warn(missing_docs)] #![warn(missing_debug_implementations)] -#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings +#![deny(intra_doc_resolution_failures)] // rustdoc is run without -D warnings #![allow(explicit_outlives_requirements)] #![allow(unused_lifetimes)] // Tell the compiler to link to either panic_abort or panic_unwind From 522ef2e9811139e80e39cd1d5da2514cf9b7a8b4 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 29 Jul 2020 23:19:12 -0700 Subject: [PATCH 06/10] Remove deny for intra doc link failures from library code, it's no longer necessary --- library/alloc/src/lib.rs | 1 - library/core/src/lib.rs | 2 -- library/std/src/lib.rs | 1 - 3 files changed, 4 deletions(-) diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index 479e0a955090f..6350e38554647 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -69,7 +69,6 @@ #![warn(deprecated_in_future)] #![warn(missing_docs)] #![warn(missing_debug_implementations)] -#![deny(intra_doc_resolution_failures)] // rustdoc is run without -D warnings #![allow(explicit_outlives_requirements)] #![allow(incomplete_features)] #![deny(unsafe_op_in_unsafe_fn)] diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 7c9dd92ffa0ee..de440a8261e90 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -61,7 +61,6 @@ #![warn(deprecated_in_future)] #![warn(missing_docs)] #![warn(missing_debug_implementations)] -#![deny(intra_doc_resolution_failures)] // rustdoc is run without -D warnings #![allow(explicit_outlives_requirements)] #![allow(incomplete_features)] #![feature(allow_internal_unstable)] @@ -149,7 +148,6 @@ #![feature(slice_ptr_get)] #![feature(no_niche)] // rust-lang/rust#68303 #![feature(unsafe_block_in_unsafe_fn)] -#![deny(intra_doc_resolution_failures)] #![deny(unsafe_op_in_unsafe_fn)] #[prelude_import] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index edd677b2ae086..74661d3456b8f 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -212,7 +212,6 @@ #![warn(deprecated_in_future)] #![warn(missing_docs)] #![warn(missing_debug_implementations)] -#![deny(intra_doc_resolution_failures)] // rustdoc is run without -D warnings #![allow(explicit_outlives_requirements)] #![allow(unused_lifetimes)] // Tell the compiler to link to either panic_abort or panic_unwind From bcb2813e01313f78f580e0e7af263c27cc77a825 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 30 Jul 2020 10:22:57 -0700 Subject: [PATCH 07/10] Update uitest expectations --- src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr | 2 +- src/test/rustdoc-ui/intra-doc-alias-ice.stderr | 2 +- src/test/rustdoc-ui/intra-link-span-ice-55723.stderr | 2 +- src/test/rustdoc-ui/intra-links-ambiguity.stderr | 2 +- src/test/rustdoc-ui/intra-links-anchors.stderr | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr index 33c391855278f..68096f5fb6900 100644 --- a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr +++ b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/deny-intra-link-resolution-failure.rs:1:9 | LL | #![deny(intra_doc_resolution_failures)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: aborting due to previous error diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr index 5ba34dd1d54af..dfd4f2dd45181 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr +++ b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/intra-doc-alias-ice.rs:1:9 | LL | #![deny(intra_doc_resolution_failures)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: aborting due to previous error diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr index 5c0ab62c6a13b..a202759e8d018 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/intra-link-span-ice-55723.rs:1:9 | LL | #![deny(intra_doc_resolution_failures)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: aborting due to previous error diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.stderr b/src/test/rustdoc-ui/intra-links-ambiguity.stderr index 94b9258bdeeac..548bb9c296baa 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.stderr +++ b/src/test/rustdoc-ui/intra-links-ambiguity.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/intra-links-ambiguity.rs:1:9 | LL | #![deny(intra_doc_resolution_failures)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to link to the struct, prefix with the item type | LL | /// [`struct@ambiguous`] is ambiguous. diff --git a/src/test/rustdoc-ui/intra-links-anchors.stderr b/src/test/rustdoc-ui/intra-links-anchors.stderr index 29a632273fa73..8f16b9a8fc44b 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.stderr +++ b/src/test/rustdoc-ui/intra-links-anchors.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/intra-links-anchors.rs:1:9 | LL | #![deny(intra_doc_resolution_failures)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `hello#people#!` contains multiple anchors --> $DIR/intra-links-anchors.rs:31:28 From 8fe438e632c0fe6a6d99f5096e21d9ab5d16fe3c Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 30 Jul 2020 10:38:55 -0700 Subject: [PATCH 08/10] intra_doc_resolution_failures -> broken_intra_doc_links --- src/doc/rustdoc/src/lints.md | 2 +- src/librustc_lint/lib.rs | 2 +- src/test/run-make-fulldeps/exit-code/lint-failure.rs | 2 +- src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs | 2 +- src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr | 2 +- src/test/rustdoc-ui/intra-doc-alias-ice.rs | 2 +- src/test/rustdoc-ui/intra-doc-alias-ice.stderr | 2 +- src/test/rustdoc-ui/intra-link-span-ice-55723.rs | 2 +- src/test/rustdoc-ui/intra-link-span-ice-55723.stderr | 2 +- src/test/rustdoc-ui/intra-links-ambiguity.rs | 2 +- src/test/rustdoc-ui/intra-links-ambiguity.stderr | 2 +- src/test/rustdoc-ui/intra-links-anchors.rs | 2 +- src/test/rustdoc-ui/intra-links-anchors.stderr | 2 +- src/test/rustdoc-ui/intra-links-private.private.stderr | 2 +- src/test/rustdoc-ui/intra-links-private.public.stderr | 2 +- src/test/rustdoc-ui/intra-links-warning-crlf.stderr | 2 +- src/test/rustdoc-ui/intra-links-warning.stderr | 2 +- src/test/rustdoc-ui/issue-74134.private.stderr | 2 +- src/test/rustdoc-ui/issue-74134.public.stderr | 2 +- src/test/rustdoc-ui/lint-group.stderr | 2 +- src/test/rustdoc-ui/reference-link-has-one-warning.stderr | 2 +- src/test/rustdoc/intra-doc-crate/additional_doc.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/module.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs | 2 +- src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs | 2 +- src/test/rustdoc/intra-doc-crate/basic.rs | 2 +- src/test/rustdoc/intra-doc-crate/hidden.rs | 2 +- src/test/rustdoc/intra-doc-crate/macro.rs | 2 +- src/test/rustdoc/intra-doc-crate/module.rs | 2 +- src/test/rustdoc/intra-doc-crate/submodule-inner.rs | 2 +- src/test/rustdoc/intra-doc-crate/submodule-outer.rs | 2 +- src/test/rustdoc/intra-doc-crate/traits.rs | 2 +- src/test/rustdoc/intra-doc-link-mod-ambiguity.rs | 2 +- src/test/rustdoc/intra-link-extern-crate.rs | 2 +- src/test/rustdoc/intra-link-in-bodies.rs | 2 +- src/test/rustdoc/intra-link-libstd-re-export.rs | 2 +- src/test/rustdoc/intra-link-prim-methods-external-core.rs | 2 +- src/test/rustdoc/intra-link-prim-methods-local.rs | 2 +- src/test/rustdoc/intra-link-prim-methods.rs | 2 +- src/test/rustdoc/intra-link-prim-precedence.rs | 2 +- src/test/rustdoc/intra-link-private.rs | 2 +- src/test/rustdoc/intra-link-proc-macro.rs | 2 +- src/test/rustdoc/intra-links-external-traits.rs | 2 +- src/test/rustdoc/through-proc-macro.rs | 2 +- 48 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index 275cadb65252b..d1d6bc1c1fe69 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -11,7 +11,7 @@ can use them like any other lints by doing this: Here is the list of the lints provided by `rustdoc`: -## intra_doc_resolution_failures +## broken_intra_doc_links This lint **warns by default** and is **nightly-only**. This lint detects when an intra-doc link fails to get resolved. For example: diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index a542f5c96fa7e..8ba79efa7c9de 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -318,7 +318,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) { store.register_renamed("async_idents", "keyword_idents"); store.register_renamed("exceeding_bitshifts", "arithmetic_overflow"); store.register_renamed("redundant_semicolon", "redundant_semicolons"); - store.register_renamed("intra_doc_link_resolution_failure", "intra_doc_resolution_failures"); + store.register_renamed("intra_doc_link_resolution_failure", "broken_intra_doc_links"); store.register_removed("unknown_features", "replaced by an error"); store.register_removed("unsigned_negation", "replaced by negate_unsigned feature gate"); store.register_removed("negate_unsigned", "cast a signed value instead"); diff --git a/src/test/run-make-fulldeps/exit-code/lint-failure.rs b/src/test/run-make-fulldeps/exit-code/lint-failure.rs index 423edeecb0ed9..df876ec237ff3 100644 --- a/src/test/run-make-fulldeps/exit-code/lint-failure.rs +++ b/src/test/run-make-fulldeps/exit-code/lint-failure.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] /// [intradoc::failure] pub fn main() { diff --git a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs index 1ef2ac105f37d..54e7689f3163f 100644 --- a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs +++ b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] /// [v2] //~ ERROR pub fn foo() {} diff --git a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr index 68096f5fb6900..c60c400c1d387 100644 --- a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr +++ b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr @@ -7,7 +7,7 @@ LL | /// [v2] note: the lint level is defined here --> $DIR/deny-intra-link-resolution-failure.rs:1:9 | -LL | #![deny(intra_doc_resolution_failures)] +LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.rs b/src/test/rustdoc-ui/intra-doc-alias-ice.rs index 5729ebb4cc017..c053e378e7147 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.rs +++ b/src/test/rustdoc-ui/intra-doc-alias-ice.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub type TypeAlias = usize; diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr index dfd4f2dd45181..e4ba4d1484637 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr +++ b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr @@ -7,7 +7,7 @@ LL | /// [broken cross-reference](TypeAlias::hoge) note: the lint level is defined here --> $DIR/intra-doc-alias-ice.rs:1:9 | -LL | #![deny(intra_doc_resolution_failures)] +LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs b/src/test/rustdoc-ui/intra-link-span-ice-55723.rs index efd492406342a..7764a6df6ee77 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] // An error in calculating spans while reporting intra-doc link resolution errors caused rustdoc to // attempt to slice in the middle of a multibyte character. See diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr index a202759e8d018..90798fdc79fb9 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr @@ -7,7 +7,7 @@ LL | /// (arr[i]) note: the lint level is defined here --> $DIR/intra-link-span-ice-55723.rs:1:9 | -LL | #![deny(intra_doc_resolution_failures)] +LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.rs b/src/test/rustdoc-ui/intra-links-ambiguity.rs index 7b2ca4f48d57b..d1597cdca66ab 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.rs +++ b/src/test/rustdoc-ui/intra-links-ambiguity.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.stderr b/src/test/rustdoc-ui/intra-links-ambiguity.stderr index 548bb9c296baa..a84c7d4d6e447 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.stderr +++ b/src/test/rustdoc-ui/intra-links-ambiguity.stderr @@ -7,7 +7,7 @@ LL | /// [`ambiguous`] is ambiguous. note: the lint level is defined here --> $DIR/intra-links-ambiguity.rs:1:9 | -LL | #![deny(intra_doc_resolution_failures)] +LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to link to the struct, prefix with the item type | diff --git a/src/test/rustdoc-ui/intra-links-anchors.rs b/src/test/rustdoc-ui/intra-links-anchors.rs index 24e3bf1832aef..ccefd2e6fabb5 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.rs +++ b/src/test/rustdoc-ui/intra-links-anchors.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] // A few tests on anchors. diff --git a/src/test/rustdoc-ui/intra-links-anchors.stderr b/src/test/rustdoc-ui/intra-links-anchors.stderr index 8f16b9a8fc44b..e3327ebcb3f27 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.stderr +++ b/src/test/rustdoc-ui/intra-links-anchors.stderr @@ -7,7 +7,7 @@ LL | /// Or maybe [Foo::f#hola]. note: the lint level is defined here --> $DIR/intra-links-anchors.rs:1:9 | -LL | #![deny(intra_doc_resolution_failures)] +LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `hello#people#!` contains multiple anchors diff --git a/src/test/rustdoc-ui/intra-links-private.private.stderr b/src/test/rustdoc-ui/intra-links-private.private.stderr index 5c40fcd826b10..77c4b67a6528f 100644 --- a/src/test/rustdoc-ui/intra-links-private.private.stderr +++ b/src/test/rustdoc-ui/intra-links-private.private.stderr @@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_resolution_failures)]` on by default + = note: `#[warn(broken_intra_doc_links)]` on by default = note: this link resolves only because you passed `--document-private-items`, but will break without warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/intra-links-private.public.stderr b/src/test/rustdoc-ui/intra-links-private.public.stderr index 93ba3229038b8..312a78e8c3ec7 100644 --- a/src/test/rustdoc-ui/intra-links-private.public.stderr +++ b/src/test/rustdoc-ui/intra-links-private.public.stderr @@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_resolution_failures)]` on by default + = note: `#[warn(broken_intra_doc_links)]` on by default = note: this link will resolve properly if you pass `--document-private-items` warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr b/src/test/rustdoc-ui/intra-links-warning-crlf.stderr index 0cf440c1fad2f..1e3a26fadfa9f 100644 --- a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr +++ b/src/test/rustdoc-ui/intra-links-warning-crlf.stderr @@ -4,7 +4,7 @@ warning: unresolved link to `error` LL | /// [error] | ^^^^^ unresolved link | - = note: `#[warn(intra_doc_resolution_failures)]` on by default + = note: `#[warn(broken_intra_doc_links)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error1` diff --git a/src/test/rustdoc-ui/intra-links-warning.stderr b/src/test/rustdoc-ui/intra-links-warning.stderr index c0091cefb4f33..53f2476295ebb 100644 --- a/src/test/rustdoc-ui/intra-links-warning.stderr +++ b/src/test/rustdoc-ui/intra-links-warning.stderr @@ -4,7 +4,7 @@ warning: unresolved link to `Foo::baz` LL | //! Test with [Foo::baz], [Bar::foo], ... | ^^^^^^^^ unresolved link | - = note: `#[warn(intra_doc_resolution_failures)]` on by default + = note: `#[warn(broken_intra_doc_links)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `Bar::foo` diff --git a/src/test/rustdoc-ui/issue-74134.private.stderr b/src/test/rustdoc-ui/issue-74134.private.stderr index 16d7c27230c2d..58772109140ca 100644 --- a/src/test/rustdoc-ui/issue-74134.private.stderr +++ b/src/test/rustdoc-ui/issue-74134.private.stderr @@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy LL | /// [`PrivateType`] | ^^^^^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_resolution_failures)]` on by default + = note: `#[warn(broken_intra_doc_links)]` on by default = note: this link resolves only because you passed `--document-private-items`, but will break without warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/issue-74134.public.stderr b/src/test/rustdoc-ui/issue-74134.public.stderr index a9ca83f810ad1..b5bea190941e6 100644 --- a/src/test/rustdoc-ui/issue-74134.public.stderr +++ b/src/test/rustdoc-ui/issue-74134.public.stderr @@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy LL | /// [`PrivateType`] | ^^^^^^^^^^^^^ this item is private | - = note: `#[warn(intra_doc_resolution_failures)]` on by default + = note: `#[warn(broken_intra_doc_links)]` on by default = note: this link will resolve properly if you pass `--document-private-items` warning: 1 warning emitted diff --git a/src/test/rustdoc-ui/lint-group.stderr b/src/test/rustdoc-ui/lint-group.stderr index 471bb71fe5d8c..04296d2e44a7c 100644 --- a/src/test/rustdoc-ui/lint-group.stderr +++ b/src/test/rustdoc-ui/lint-group.stderr @@ -39,7 +39,7 @@ note: the lint level is defined here | LL | #![deny(rustdoc)] | ^^^^^^^ - = note: `#[deny(intra_doc_resolution_failures)]` implied by `#[deny(rustdoc)]` + = note: `#[deny(broken_intra_doc_links)]` implied by `#[deny(rustdoc)]` = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: aborting due to 3 previous errors diff --git a/src/test/rustdoc-ui/reference-link-has-one-warning.stderr b/src/test/rustdoc-ui/reference-link-has-one-warning.stderr index e5276a2b4aa84..a1eeb60f1785a 100644 --- a/src/test/rustdoc-ui/reference-link-has-one-warning.stderr +++ b/src/test/rustdoc-ui/reference-link-has-one-warning.stderr @@ -4,7 +4,7 @@ warning: `[with#anchor#error]` has an issue with the link anchor. LL | /// docs [label][with#anchor#error] | ^^^^^^^^^^^^^^^^^ only one `#` is allowed in a link | - = note: `#[warn(intra_doc_resolution_failures)]` on by default + = note: `#[warn(broken_intra_doc_links)]` on by default warning: 1 warning emitted diff --git a/src/test/rustdoc/intra-doc-crate/additional_doc.rs b/src/test/rustdoc/intra-doc-crate/additional_doc.rs index ca30895e3ce2d..837390b3c7161 100644 --- a/src/test/rustdoc/intra-doc-crate/additional_doc.rs +++ b/src/test/rustdoc/intra-doc-crate/additional_doc.rs @@ -1,6 +1,6 @@ // aux-build:additional_doc.rs // build-aux-docs -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] extern crate my_rand; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs index b0f6dda865b63..849d25687337b 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/additional_doc.rs @@ -1,5 +1,5 @@ #![crate_name = "my_rand"] -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub trait RngCore {} /// Rng extends [`RngCore`]. diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs index f2bc8f470b87f..b543ae764c05b 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rs @@ -1,5 +1,5 @@ #![crate_name = "hidden_dep"] -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] #[doc(hidden)] pub mod __reexport { diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs index a98fec734d70e..5342baecbc4b8 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/intra-doc-basic.rs @@ -1,5 +1,5 @@ #![crate_name = "a"] -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub struct Foo; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs index 59c4d7e00702c..a94f9e5dcca2e 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/macro_inner.rs @@ -1,5 +1,5 @@ #![crate_name = "macro_inner"] -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub struct Foo; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs index 2dc70211262f5..b7e3913f108f7 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/module.rs @@ -1,5 +1,5 @@ #![crate_name = "module_inner"] -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] /// [SomeType] links to [bar] pub struct SomeType; pub trait SomeTrait {} diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs index d79a1b1b12e65..8ae0f6c16b3d8 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-inner.rs @@ -1,5 +1,5 @@ #![crate_name = "a"] -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub mod bar { pub struct Bar; diff --git a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs index e1f0bd9c6dd56..d90c529e38552 100644 --- a/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs +++ b/src/test/rustdoc/intra-doc-crate/auxiliary/submodule-outer.rs @@ -1,5 +1,5 @@ #![crate_name = "bar"] -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub trait Foo { /// [`Bar`] [`Baz`] diff --git a/src/test/rustdoc/intra-doc-crate/basic.rs b/src/test/rustdoc/intra-doc-crate/basic.rs index 88b18ed539bd2..6ab9140c3c385 100644 --- a/src/test/rustdoc/intra-doc-crate/basic.rs +++ b/src/test/rustdoc/intra-doc-crate/basic.rs @@ -1,6 +1,6 @@ // aux-build:intra-doc-basic.rs // build-aux-docs -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] // from https://github.com/rust-lang/rust/issues/65983 extern crate a; diff --git a/src/test/rustdoc/intra-doc-crate/hidden.rs b/src/test/rustdoc/intra-doc-crate/hidden.rs index 6d832b5a5f7ea..9c9d4c649455e 100644 --- a/src/test/rustdoc/intra-doc-crate/hidden.rs +++ b/src/test/rustdoc/intra-doc-crate/hidden.rs @@ -1,6 +1,6 @@ // aux-build:hidden.rs // build-aux-docs -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] // tests https://github.com/rust-lang/rust/issues/73363 diff --git a/src/test/rustdoc/intra-doc-crate/macro.rs b/src/test/rustdoc/intra-doc-crate/macro.rs index dd5dbec144da2..311b16dff13bc 100644 --- a/src/test/rustdoc/intra-doc-crate/macro.rs +++ b/src/test/rustdoc/intra-doc-crate/macro.rs @@ -2,7 +2,7 @@ // aux-build:macro_inner.rs // aux-build:proc_macro.rs // build-aux-docs -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] extern crate macro_inner; extern crate proc_macro_inner; diff --git a/src/test/rustdoc/intra-doc-crate/module.rs b/src/test/rustdoc/intra-doc-crate/module.rs index 0a6cc27f4a045..9039e344f7b00 100644 --- a/src/test/rustdoc/intra-doc-crate/module.rs +++ b/src/test/rustdoc/intra-doc-crate/module.rs @@ -1,7 +1,7 @@ // outer.rs // aux-build: module.rs // build-aux-docs -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] extern crate module_inner; // @has 'module/bar/index.html' '//a[@href="../../module_inner/trait.SomeTrait.html"]' 'SomeTrait' // @has 'module/bar/index.html' '//a[@href="../../module_inner/struct.SomeType.html"]' 'SomeType' diff --git a/src/test/rustdoc/intra-doc-crate/submodule-inner.rs b/src/test/rustdoc/intra-doc-crate/submodule-inner.rs index f86547f90e112..e1465816368bf 100644 --- a/src/test/rustdoc/intra-doc-crate/submodule-inner.rs +++ b/src/test/rustdoc/intra-doc-crate/submodule-inner.rs @@ -1,6 +1,6 @@ // aux-build:submodule-inner.rs // build-aux-docs -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] extern crate a; diff --git a/src/test/rustdoc/intra-doc-crate/submodule-outer.rs b/src/test/rustdoc/intra-doc-crate/submodule-outer.rs index 62781da479ffb..45f561328f279 100644 --- a/src/test/rustdoc/intra-doc-crate/submodule-outer.rs +++ b/src/test/rustdoc/intra-doc-crate/submodule-outer.rs @@ -1,6 +1,6 @@ // aux-build:submodule-outer.rs // edition:2018 -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] extern crate bar as bar_; diff --git a/src/test/rustdoc/intra-doc-crate/traits.rs b/src/test/rustdoc/intra-doc-crate/traits.rs index f12ba5b21fc36..07f9fb6331333 100644 --- a/src/test/rustdoc/intra-doc-crate/traits.rs +++ b/src/test/rustdoc/intra-doc-crate/traits.rs @@ -3,7 +3,7 @@ // aux-build:traits.rs // build-aux-docs // ignore-tidy-line-length -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] extern crate inner; use inner::SomeTrait; diff --git a/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs b/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs index 38fa3d0c7dbac..bd733e1023033 100644 --- a/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs +++ b/src/test/rustdoc/intra-doc-link-mod-ambiguity.rs @@ -1,6 +1,6 @@ // ignore-tidy-linelength -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub fn foo() { diff --git a/src/test/rustdoc/intra-link-extern-crate.rs b/src/test/rustdoc/intra-link-extern-crate.rs index 2af6880c6328e..193bca704bfbd 100644 --- a/src/test/rustdoc/intra-link-extern-crate.rs +++ b/src/test/rustdoc/intra-link-extern-crate.rs @@ -4,6 +4,6 @@ // though they would never actually get displayed. This tripped intra-doc-link resolution failures, // for items that aren't under our control, and not actually getting documented! -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] extern crate inner; diff --git a/src/test/rustdoc/intra-link-in-bodies.rs b/src/test/rustdoc/intra-link-in-bodies.rs index 48244aa2ac792..ec965a99dc240 100644 --- a/src/test/rustdoc/intra-link-in-bodies.rs +++ b/src/test/rustdoc/intra-link-in-bodies.rs @@ -1,6 +1,6 @@ // we need to make sure that intra-doc links on trait impls get resolved in the right scope -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub mod inner { pub struct SomethingOutOfScope; diff --git a/src/test/rustdoc/intra-link-libstd-re-export.rs b/src/test/rustdoc/intra-link-libstd-re-export.rs index 07623da50171d..d0af3aec66097 100644 --- a/src/test/rustdoc/intra-link-libstd-re-export.rs +++ b/src/test/rustdoc/intra-link-libstd-re-export.rs @@ -1,3 +1,3 @@ -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub use std::*; diff --git a/src/test/rustdoc/intra-link-prim-methods-external-core.rs b/src/test/rustdoc/intra-link-prim-methods-external-core.rs index 8166489c7a62b..c8ef4c015997b 100644 --- a/src/test/rustdoc/intra-link-prim-methods-external-core.rs +++ b/src/test/rustdoc/intra-link-prim-methods-external-core.rs @@ -4,7 +4,7 @@ // ignore-windows // ignore-tidy-linelength -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] #![feature(no_core, lang_items)] #![no_core] #![crate_type = "rlib"] diff --git a/src/test/rustdoc/intra-link-prim-methods-local.rs b/src/test/rustdoc/intra-link-prim-methods-local.rs index c42c6986233c5..d448acf7f9682 100644 --- a/src/test/rustdoc/intra-link-prim-methods-local.rs +++ b/src/test/rustdoc/intra-link-prim-methods-local.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] #![feature(no_core, lang_items)] #![no_core] #![crate_type = "rlib"] diff --git a/src/test/rustdoc/intra-link-prim-methods.rs b/src/test/rustdoc/intra-link-prim-methods.rs index bfb974d95b365..94c80c996c1e0 100644 --- a/src/test/rustdoc/intra-link-prim-methods.rs +++ b/src/test/rustdoc/intra-link-prim-methods.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] // ignore-tidy-linelength diff --git a/src/test/rustdoc/intra-link-prim-precedence.rs b/src/test/rustdoc/intra-link-prim-precedence.rs index ee0ef743a1e93..5f10c1ec4a75c 100644 --- a/src/test/rustdoc/intra-link-prim-precedence.rs +++ b/src/test/rustdoc/intra-link-prim-precedence.rs @@ -1,5 +1,5 @@ // ignore-tidy-linelength -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] pub mod char {} diff --git a/src/test/rustdoc/intra-link-private.rs b/src/test/rustdoc/intra-link-private.rs index 08a2a8070cb86..cf8bc0b15869f 100644 --- a/src/test/rustdoc/intra-link-private.rs +++ b/src/test/rustdoc/intra-link-private.rs @@ -2,7 +2,7 @@ // These failures were legitimate, but not truly relevant - the docs in question couldn't be // checked for accuracy anyway. -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] /// ooh, i'm a [rebel] just for kicks struct SomeStruct; diff --git a/src/test/rustdoc/intra-link-proc-macro.rs b/src/test/rustdoc/intra-link-proc-macro.rs index eef82c4ac192c..7a8403255edb6 100644 --- a/src/test/rustdoc/intra-link-proc-macro.rs +++ b/src/test/rustdoc/intra-link-proc-macro.rs @@ -1,6 +1,6 @@ // aux-build:intra-link-proc-macro-macro.rs // build-aux-docs -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] extern crate intra_link_proc_macro_macro; diff --git a/src/test/rustdoc/intra-links-external-traits.rs b/src/test/rustdoc/intra-links-external-traits.rs index de00f787bd292..de76f29476c66 100644 --- a/src/test/rustdoc/intra-links-external-traits.rs +++ b/src/test/rustdoc/intra-links-external-traits.rs @@ -2,7 +2,7 @@ // ignore-cross-compile #![crate_name = "outer"] -#![deny(intra_doc_resolution_failures)] +#![deny(broken_intra_doc_links)] // using a trait that has intra-doc links on it from another crate (whether re-exporting or just // implementing it) used to give spurious resolution failure warnings diff --git a/src/test/rustdoc/through-proc-macro.rs b/src/test/rustdoc/through-proc-macro.rs index fb84ef614744c..613410871f0d1 100644 --- a/src/test/rustdoc/through-proc-macro.rs +++ b/src/test/rustdoc/through-proc-macro.rs @@ -1,6 +1,6 @@ // aux-build:through-proc-macro-aux.rs // build-aux-docs -#![warn(intra_doc_resolution_failures)] +#![warn(broken_intra_doc_links)] extern crate some_macros; #[some_macros::second] From e25a67fa6cbfacea80f5579149299f842775be79 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 30 Jul 2020 10:39:16 -0700 Subject: [PATCH 09/10] Rename the lint again --- src/librustc_lint/lib.rs | 6 +++--- src/librustc_session/lint/builtin.rs | 4 ++-- src/librustdoc/core.rs | 2 +- src/librustdoc/passes/collect_intra_doc_links.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 8ba79efa7c9de..15a9affbff7e9 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -61,8 +61,8 @@ use rustc_hir::def_id::LocalDefId; use rustc_middle::ty::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_session::lint::builtin::{ - BARE_TRAIT_OBJECTS, ELIDED_LIFETIMES_IN_PATHS, EXPLICIT_OUTLIVES_REQUIREMENTS, - INTRA_DOC_RESOLUTION_FAILURES, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, + BARE_TRAIT_OBJECTS, BROKEN_INTRA_DOC_LINKS, ELIDED_LIFETIMES_IN_PATHS, + EXPLICIT_OUTLIVES_REQUIREMENTS, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS, }; use rustc_span::symbol::{Ident, Symbol}; @@ -303,7 +303,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) { add_lint_group!( "rustdoc", - INTRA_DOC_RESOLUTION_FAILURES, + BROKEN_INTRA_DOC_LINKS, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS diff --git a/src/librustc_session/lint/builtin.rs b/src/librustc_session/lint/builtin.rs index f2a5289c8c445..144a06a4916bd 100644 --- a/src/librustc_session/lint/builtin.rs +++ b/src/librustc_session/lint/builtin.rs @@ -398,7 +398,7 @@ declare_lint! { } declare_lint! { - pub INTRA_DOC_RESOLUTION_FAILURES, + pub BROKEN_INTRA_DOC_LINKS, Warn, "failures in resolving intra-doc link targets" } @@ -601,7 +601,7 @@ declare_lint_pass! { ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE, UNSTABLE_NAME_COLLISIONS, IRREFUTABLE_LET_PATTERNS, - INTRA_DOC_RESOLUTION_FAILURES, + BROKEN_INTRA_DOC_LINKS, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_CRATE_LEVEL_DOCS, MISSING_DOC_CODE_EXAMPLES, diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 35c340bf251d9..338aba36d0479 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -315,7 +315,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt let cpath = Some(input.clone()); let input = Input::File(input); - let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_RESOLUTION_FAILURES.name; + let intra_link_resolution_failure_name = lint::builtin::BROKEN_INTRA_DOC_LINKS.name; let missing_docs = rustc_lint::builtin::MISSING_DOCS.name; let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name; let private_doc_tests = rustc_lint::builtin::PRIVATE_DOC_TESTS.name; diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 02a9483f9293a..bf7a43236e061 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -867,7 +867,7 @@ fn report_diagnostic( let attrs = &item.attrs; let sp = span_of_attrs(attrs).unwrap_or(item.source.span()); - cx.tcx.struct_span_lint_hir(lint::builtin::INTRA_DOC_RESOLUTION_FAILURES, hir_id, sp, |lint| { + cx.tcx.struct_span_lint_hir(lint::builtin::BROKEN_INTRA_DOC_LINKS, hir_id, sp, |lint| { let mut diag = lint.build(msg); let span = link_range From c17eb566c20bb4c98a1e74f7f0461483ff175310 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 30 Jul 2020 10:40:17 -0700 Subject: [PATCH 10/10] Fix uitests --- src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr | 2 +- src/test/rustdoc-ui/intra-doc-alias-ice.stderr | 2 +- src/test/rustdoc-ui/intra-link-span-ice-55723.stderr | 2 +- src/test/rustdoc-ui/intra-links-ambiguity.stderr | 2 +- src/test/rustdoc-ui/intra-links-anchors.stderr | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr index c60c400c1d387..7530e3ad0f551 100644 --- a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr +++ b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/deny-intra-link-resolution-failure.rs:1:9 | LL | #![deny(broken_intra_doc_links)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: aborting due to previous error diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr index e4ba4d1484637..f1c07e31cd753 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr +++ b/src/test/rustdoc-ui/intra-doc-alias-ice.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/intra-doc-alias-ice.rs:1:9 | LL | #![deny(broken_intra_doc_links)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: aborting due to previous error diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr index 90798fdc79fb9..6b0ff8f116295 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/intra-link-span-ice-55723.rs:1:9 | LL | #![deny(broken_intra_doc_links)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: aborting due to previous error diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.stderr b/src/test/rustdoc-ui/intra-links-ambiguity.stderr index a84c7d4d6e447..35262c1b6122e 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.stderr +++ b/src/test/rustdoc-ui/intra-links-ambiguity.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/intra-links-ambiguity.rs:1:9 | LL | #![deny(broken_intra_doc_links)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ help: to link to the struct, prefix with the item type | LL | /// [`struct@ambiguous`] is ambiguous. diff --git a/src/test/rustdoc-ui/intra-links-anchors.stderr b/src/test/rustdoc-ui/intra-links-anchors.stderr index e3327ebcb3f27..e737b84320d94 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.stderr +++ b/src/test/rustdoc-ui/intra-links-anchors.stderr @@ -8,7 +8,7 @@ note: the lint level is defined here --> $DIR/intra-links-anchors.rs:1:9 | LL | #![deny(broken_intra_doc_links)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ error: `hello#people#!` contains multiple anchors --> $DIR/intra-links-anchors.rs:31:28