intra_doc_resolution_failures -> broken_intra_doc_links
This commit is contained in:
parent
bcb2813e01
commit
8fe438e632
@ -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:
|
||||
|
@ -318,7 +318,7 @@ macro_rules! register_passes {
|
||||
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");
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
/// [intradoc::failure]
|
||||
pub fn main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
/// [v2] //~ ERROR
|
||||
pub fn foo() {}
|
||||
|
@ -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 `\]`
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
pub type TypeAlias = usize;
|
||||
|
||||
|
@ -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 `\]`
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 `\]`
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
|
@ -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
|
||||
|
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
// A few tests on anchors.
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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`
|
||||
|
@ -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`
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![crate_name = "my_rand"]
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
pub trait RngCore {}
|
||||
/// Rng extends [`RngCore`].
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![crate_name = "hidden_dep"]
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod __reexport {
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![crate_name = "a"]
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
pub struct Foo;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![crate_name = "macro_inner"]
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
pub struct Foo;
|
||||
|
||||
|
@ -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 {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![crate_name = "a"]
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
pub mod bar {
|
||||
pub struct Bar;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![crate_name = "bar"]
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
pub trait Foo {
|
||||
/// [`Bar`] [`Baz`]
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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_;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// ignore-tidy-linelength
|
||||
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
|
||||
pub fn foo() {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -1,3 +1,3 @@
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
pub use std::*;
|
||||
|
@ -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"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
#![crate_type = "rlib"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
// ignore-tidy-linelength
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-tidy-linelength
|
||||
#![deny(intra_doc_resolution_failures)]
|
||||
#![deny(broken_intra_doc_links)]
|
||||
|
||||
pub mod char {}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user