diff --git a/src/test/rustdoc/intra-doc/auxiliary/through-proc-macro-aux.rs b/src/test/rustdoc-ui/intra-doc/auxiliary/through-proc-macro-aux.rs similarity index 100% rename from src/test/rustdoc/intra-doc/auxiliary/through-proc-macro-aux.rs rename to src/test/rustdoc-ui/intra-doc/auxiliary/through-proc-macro-aux.rs diff --git a/src/test/rustdoc/intra-doc/through-proc-macro.rs b/src/test/rustdoc-ui/intra-doc/through-proc-macro.rs similarity index 52% rename from src/test/rustdoc/intra-doc/through-proc-macro.rs rename to src/test/rustdoc-ui/intra-doc/through-proc-macro.rs index 613410871f0..7628c3928fe 100644 --- a/src/test/rustdoc/intra-doc/through-proc-macro.rs +++ b/src/test/rustdoc-ui/intra-doc/through-proc-macro.rs @@ -1,11 +1,17 @@ +// check-pass // aux-build:through-proc-macro-aux.rs // build-aux-docs -#![warn(broken_intra_doc_links)] + +// Ensure rustdoc doesn't panic on this code. + +#![warn(rustdoc::broken_intra_doc_links)] + extern crate some_macros; #[some_macros::second] pub enum Boom { /// [Oooops] + //~^ WARNING unresolved link to `Oooops` Bam, } diff --git a/src/test/rustdoc-ui/intra-doc/through-proc-macro.stderr b/src/test/rustdoc-ui/intra-doc/through-proc-macro.stderr new file mode 100644 index 00000000000..f0a7ed1785b --- /dev/null +++ b/src/test/rustdoc-ui/intra-doc/through-proc-macro.stderr @@ -0,0 +1,15 @@ +warning: unresolved link to `Oooops` + --> $DIR/through-proc-macro.rs:13:10 + | +LL | /// [Oooops] + | ^^^^^^ no item named `Oooops` in scope + | +note: the lint level is defined here + --> $DIR/through-proc-macro.rs:7:9 + | +LL | #![warn(rustdoc::broken_intra_doc_links)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` + +warning: 1 warning emitted + diff --git a/src/test/rustdoc/auto-impl-primitive.rs b/src/test/rustdoc/auto-impl-primitive.rs index 83631b89f28..172333d445d 100644 --- a/src/test/rustdoc/auto-impl-primitive.rs +++ b/src/test/rustdoc/auto-impl-primitive.rs @@ -1,4 +1,7 @@ +#![feature(rustdoc_internals)] + #![crate_name = "foo"] + pub use std::fs::File; // @has 'foo/primitive.i16.html' '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementation' diff --git a/src/test/rustdoc/bad-codeblock-syntax.rs b/src/test/rustdoc/bad-codeblock-syntax.rs index 920877028d0..9ec089fd7ad 100644 --- a/src/test/rustdoc/bad-codeblock-syntax.rs +++ b/src/test/rustdoc/bad-codeblock-syntax.rs @@ -1,3 +1,5 @@ +#![allow(rustdoc::invalid_rust_codeblocks)] + // @has bad_codeblock_syntax/fn.foo.html // @has - '//*[@class="docblock"]' '\_' /// ``` diff --git a/src/test/rustdoc/check-source-code-urls-to-def.rs b/src/test/rustdoc/check-source-code-urls-to-def.rs index 0cb8e423016..ca4179d403d 100644 --- a/src/test/rustdoc/check-source-code-urls-to-def.rs +++ b/src/test/rustdoc/check-source-code-urls-to-def.rs @@ -2,6 +2,8 @@ // aux-build:source_code.rs // build-aux-docs +#![feature(rustdoc_internals)] + #![crate_name = "foo"] extern crate source_code; @@ -29,21 +31,20 @@ fn babar() {} // @has - '//a/@href' '/struct.String.html' // @has - '//a/@href' '/primitive.u32.html' // @has - '//a/@href' '/primitive.str.html' -// @count - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#21"]' 5 +// @count - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#23"]' 5 // @has - '//a[@href="../../source_code/struct.SourceCode.html"]' 'source_code::SourceCode' pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::SourceCode) { let x = 12; let y: Foo = Foo; let z: Bar = bar::Bar { field: Foo }; babar(); - // @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#24"]' 'hello' + // @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#26"]' 'hello' y.hello(); } // @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait' // @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait' -pub fn foo2(t: &T, v: &V, b: bool) { -} +pub fn foo2(t: &T, v: &V, b: bool) {} // @has - '//a[@href="../../foo/primitive.bool.html"]' 'bool' #[doc(primitive = "bool")] diff --git a/src/test/rustdoc/const-generics/const-impl.rs b/src/test/rustdoc/const-generics/const-impl.rs index fed37f6c9a2..cda900773ab 100644 --- a/src/test/rustdoc/const-generics/const-impl.rs +++ b/src/test/rustdoc/const-generics/const-impl.rs @@ -1,3 +1,5 @@ +#![allow(incomplete_features)] + #![feature(adt_const_params)] #![crate_name = "foo"] @@ -15,15 +17,15 @@ pub struct VSet { inner: Vec, } -// @has foo/struct.VSet.html '//div[@id="impl"]/h3[@class="code-header in-band"]' 'impl VSet' -impl VSet { +// @has foo/struct.VSet.html '//div[@id="impl"]/h3[@class="code-header in-band"]' 'impl VSet' +impl VSet { pub fn new() -> Self { Self { inner: Vec::new() } } } -// @has foo/struct.VSet.html '//div[@id="impl-1"]/h3[@class="code-header in-band"]' 'impl VSet' -impl VSet { +// @has foo/struct.VSet.html '//div[@id="impl-1"]/h3[@class="code-header in-band"]' 'impl VSet' +impl VSet { pub fn new() -> Self { Self { inner: Vec::new() } } @@ -31,7 +33,7 @@ impl VSet { pub struct Escape; -// @has foo/struct.Escape.html '//div[@id="impl"]/h3[@class="code-header in-band"]' 'impl Escape<{ r#""# }>' -impl Escape<{ r#""# }> { +// @has foo/struct.Escape.html '//div[@id="impl"]/h3[@class="code-header in-band"]' 'impl Escapealert("Escape");"#>' +impl Escapealert("Escape");"#> { pub fn f() {} } diff --git a/src/test/rustdoc/default-trait-method.rs b/src/test/rustdoc/default-trait-method.rs index 3d6ebef5a1d..6d0e339c48d 100644 --- a/src/test/rustdoc/default-trait-method.rs +++ b/src/test/rustdoc/default-trait-method.rs @@ -1,4 +1,4 @@ -#![feature(specialization)] +#![feature(min_specialization)] // @has default_trait_method/trait.Item.html // @has - '//*[@id="tymethod.foo"]' 'fn foo()' diff --git a/src/test/rustdoc/doc-cfg.rs b/src/test/rustdoc/doc-cfg.rs index 416ffb60098..8b2b7870c25 100644 --- a/src/test/rustdoc/doc-cfg.rs +++ b/src/test/rustdoc/doc-cfg.rs @@ -96,6 +96,6 @@ pub fn uses_cfg_target_feature() { // @has doc_cfg/fn.multiple_attrs.html \ // '//*[@id="main"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'This is supported on x and y and z only.' -#[doc(inline, cfg(x))] +#[doc(cfg(x))] #[doc(cfg(y), cfg(z))] pub fn multiple_attrs() {} diff --git a/src/test/rustdoc/intra-doc/associated-defaults.rs b/src/test/rustdoc/intra-doc/associated-defaults.rs index 68647127fe8..c7e66c826be 100644 --- a/src/test/rustdoc/intra-doc/associated-defaults.rs +++ b/src/test/rustdoc/intra-doc/associated-defaults.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(rustdoc::broken_intra_doc_links)] #![feature(associated_type_defaults)] pub trait TraitWithDefault { diff --git a/src/test/rustdoc/intra-doc/associated-items.rs b/src/test/rustdoc/intra-doc/associated-items.rs index d9fed2d6951..9b70ea054ad 100644 --- a/src/test/rustdoc/intra-doc/associated-items.rs +++ b/src/test/rustdoc/intra-doc/associated-items.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(rustdoc::broken_intra_doc_links)] /// [`std::collections::BTreeMap::into_iter`] /// [`String::from`] is ambiguous as to which `From` impl diff --git a/src/test/rustdoc/intra-doc/auxiliary/my-core.rs b/src/test/rustdoc/intra-doc/auxiliary/my-core.rs index 92cfd46188b..bb70073fc69 100644 --- a/src/test/rustdoc/intra-doc/auxiliary/my-core.rs +++ b/src/test/rustdoc/intra-doc/auxiliary/my-core.rs @@ -1,4 +1,4 @@ -#![feature(no_core, lang_items)] +#![feature(no_core, lang_items, rustdoc_internals)] #![no_core] #![crate_type="rlib"] diff --git a/src/test/rustdoc/intra-doc/cross-crate/additional_doc.rs b/src/test/rustdoc/intra-doc/cross-crate/additional_doc.rs index 85c5866ca7e..e52fb9b1c9f 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/additional_doc.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/additional_doc.rs @@ -1,6 +1,6 @@ // aux-build:additional_doc.rs // build-aux-docs -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] extern crate my_rand; diff --git a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/additional_doc.rs b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/additional_doc.rs index 849d2568733..684fdd449b8 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/additional_doc.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/additional_doc.rs @@ -1,5 +1,5 @@ #![crate_name = "my_rand"] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub trait RngCore {} /// Rng extends [`RngCore`]. diff --git a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/hidden.rs b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/hidden.rs index b543ae764c0..34f4e9f635f 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/hidden.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/hidden.rs @@ -1,5 +1,5 @@ #![crate_name = "hidden_dep"] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] #[doc(hidden)] pub mod __reexport { diff --git a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/intra-doc-basic.rs b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/intra-doc-basic.rs index 5342baecbc4..d6a82996689 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/intra-doc-basic.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/intra-doc-basic.rs @@ -1,5 +1,5 @@ #![crate_name = "a"] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub struct Foo; diff --git a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/macro_inner.rs b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/macro_inner.rs index a94f9e5dcca..cb7a8afb60e 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/macro_inner.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/macro_inner.rs @@ -1,5 +1,5 @@ #![crate_name = "macro_inner"] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub struct Foo; diff --git a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/module.rs b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/module.rs index b7e3913f108..018fdedd9ed 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/module.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/module.rs @@ -1,5 +1,5 @@ #![crate_name = "module_inner"] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] /// [SomeType] links to [bar] pub struct SomeType; pub trait SomeTrait {} diff --git a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/submodule-inner.rs b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/submodule-inner.rs index 8ae0f6c16b3..0612f53d6a7 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/submodule-inner.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/submodule-inner.rs @@ -1,5 +1,5 @@ #![crate_name = "a"] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub mod bar { pub struct Bar; diff --git a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/submodule-outer.rs b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/submodule-outer.rs index d90c529e385..105eb8e1120 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/auxiliary/submodule-outer.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/auxiliary/submodule-outer.rs @@ -1,5 +1,5 @@ #![crate_name = "bar"] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub trait Foo { /// [`Bar`] [`Baz`] diff --git a/src/test/rustdoc/intra-doc/cross-crate/basic.rs b/src/test/rustdoc/intra-doc/cross-crate/basic.rs index 6ab9140c3c3..ad7454918b4 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/basic.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/basic.rs @@ -1,6 +1,6 @@ // aux-build:intra-doc-basic.rs // build-aux-docs -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] // from https://github.com/rust-lang/rust/issues/65983 extern crate a; diff --git a/src/test/rustdoc/intra-doc/cross-crate/hidden.rs b/src/test/rustdoc/intra-doc/cross-crate/hidden.rs index 31337f20f18..4f7d075ba48 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/hidden.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/hidden.rs @@ -1,6 +1,6 @@ // aux-build:hidden.rs // build-aux-docs -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] // tests https://github.com/rust-lang/rust/issues/73363 diff --git a/src/test/rustdoc/intra-doc/cross-crate/macro.rs b/src/test/rustdoc/intra-doc/cross-crate/macro.rs index 62659ce689a..32f0a55d3c6 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/macro.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/macro.rs @@ -1,7 +1,7 @@ // aux-build:macro_inner.rs // aux-build:proc_macro.rs // build-aux-docs -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] extern crate macro_inner; extern crate proc_macro_inner; diff --git a/src/test/rustdoc/intra-doc/cross-crate/module.rs b/src/test/rustdoc/intra-doc/cross-crate/module.rs index 9039e344f7b..fde9322657d 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/module.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/module.rs @@ -1,7 +1,7 @@ // outer.rs // aux-build: module.rs // build-aux-docs -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::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/cross-crate/submodule-inner.rs b/src/test/rustdoc/intra-doc/cross-crate/submodule-inner.rs index e1465816368..577fe78a508 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/submodule-inner.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/submodule-inner.rs @@ -1,6 +1,6 @@ // aux-build:submodule-inner.rs // build-aux-docs -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] extern crate a; diff --git a/src/test/rustdoc/intra-doc/cross-crate/submodule-outer.rs b/src/test/rustdoc/intra-doc/cross-crate/submodule-outer.rs index db7952b5ace..d0c0b7e85ae 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/submodule-outer.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/submodule-outer.rs @@ -1,6 +1,6 @@ // aux-build:submodule-outer.rs // edition:2018 -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] extern crate bar as bar_; diff --git a/src/test/rustdoc/intra-doc/cross-crate/traits.rs b/src/test/rustdoc/intra-doc/cross-crate/traits.rs index 68f5cb3a092..7b9554bfdb0 100644 --- a/src/test/rustdoc/intra-doc/cross-crate/traits.rs +++ b/src/test/rustdoc/intra-doc/cross-crate/traits.rs @@ -1,6 +1,6 @@ // aux-build:traits.rs // build-aux-docs -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] extern crate inner; use inner::SomeTrait; diff --git a/src/test/rustdoc/intra-doc/disambiguators-removed.rs b/src/test/rustdoc/intra-doc/disambiguators-removed.rs index d782c5cf5dc..331a314130a 100644 --- a/src/test/rustdoc/intra-doc/disambiguators-removed.rs +++ b/src/test/rustdoc/intra-doc/disambiguators-removed.rs @@ -1,4 +1,4 @@ -#![deny(intra_doc_link_resolution_failure)] +#![deny(rustdoc::broken_intra_doc_links)] // first try backticks /// Trait: [`trait@Name`], fn: [`fn@Name`], [`Name`][`macro@Name`] // @has disambiguators_removed/struct.AtDisambiguator.html diff --git a/src/test/rustdoc/intra-doc/email-address.rs b/src/test/rustdoc/intra-doc/email-address.rs index c407eb80da2..ae74fbbc892 100644 --- a/src/test/rustdoc/intra-doc/email-address.rs +++ b/src/test/rustdoc/intra-doc/email-address.rs @@ -1,3 +1,5 @@ +#![allow(rustdoc::broken_intra_doc_links)] + //! Email me at . //! Email me at . //! Email me at (this warns but will still become a link). diff --git a/src/test/rustdoc/intra-doc/extern-crate.rs b/src/test/rustdoc/intra-doc/extern-crate.rs index 193bca704bf..4e4438dea03 100644 --- a/src/test/rustdoc/intra-doc/extern-crate.rs +++ b/src/test/rustdoc/intra-doc/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(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] extern crate inner; diff --git a/src/test/rustdoc/intra-doc/external-traits.rs b/src/test/rustdoc/intra-doc/external-traits.rs index de76f29476c..a0a66f242c9 100644 --- a/src/test/rustdoc/intra-doc/external-traits.rs +++ b/src/test/rustdoc/intra-doc/external-traits.rs @@ -2,7 +2,7 @@ // ignore-cross-compile #![crate_name = "outer"] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::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/intra-doc/in-bodies.rs b/src/test/rustdoc/intra-doc/in-bodies.rs index ec965a99dc2..55169e5d3c4 100644 --- a/src/test/rustdoc/intra-doc/in-bodies.rs +++ b/src/test/rustdoc/intra-doc/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(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub mod inner { pub struct SomethingOutOfScope; diff --git a/src/test/rustdoc/intra-doc/issue-82209.rs b/src/test/rustdoc/intra-doc/issue-82209.rs index 68a5672a8d2..a5fe855cb36 100644 --- a/src/test/rustdoc/intra-doc/issue-82209.rs +++ b/src/test/rustdoc/intra-doc/issue-82209.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub enum Foo { Bar { abc: i32, diff --git a/src/test/rustdoc/intra-doc/libstd-re-export.rs b/src/test/rustdoc/intra-doc/libstd-re-export.rs index fc0ff904389..6c41eb2b5b7 100644 --- a/src/test/rustdoc/intra-doc/libstd-re-export.rs +++ b/src/test/rustdoc/intra-doc/libstd-re-export.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] #![feature(intra_doc_pointers)] pub use std::*; diff --git a/src/test/rustdoc/intra-doc/mod-ambiguity.rs b/src/test/rustdoc/intra-doc/mod-ambiguity.rs index 24b9dc30a9e..0c7acbaf093 100644 --- a/src/test/rustdoc/intra-doc/mod-ambiguity.rs +++ b/src/test/rustdoc/intra-doc/mod-ambiguity.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub fn foo() { diff --git a/src/test/rustdoc/intra-doc/prim-assoc.rs b/src/test/rustdoc/intra-doc/prim-assoc.rs index c73140420ff..dfa7db8a558 100644 --- a/src/test/rustdoc/intra-doc/prim-assoc.rs +++ b/src/test/rustdoc/intra-doc/prim-assoc.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] //! [i32::MAX] // @has prim_assoc/index.html '//a[@href="{{channel}}/std/primitive.i32.html#associatedconstant.MAX"]' "i32::MAX" diff --git a/src/test/rustdoc/intra-doc/prim-methods-external-core.rs b/src/test/rustdoc/intra-doc/prim-methods-external-core.rs index 9d869984bbd..47ac953f266 100644 --- a/src/test/rustdoc/intra-doc/prim-methods-external-core.rs +++ b/src/test/rustdoc/intra-doc/prim-methods-external-core.rs @@ -3,7 +3,7 @@ // ignore-cross-compile // only-linux -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] #![feature(no_core, lang_items)] #![no_core] #![crate_type = "rlib"] diff --git a/src/test/rustdoc/intra-doc/prim-methods-local.rs b/src/test/rustdoc/intra-doc/prim-methods-local.rs index cfb3c3842ab..266bfa20731 100644 --- a/src/test/rustdoc/intra-doc/prim-methods-local.rs +++ b/src/test/rustdoc/intra-doc/prim-methods-local.rs @@ -1,5 +1,5 @@ -#![deny(broken_intra_doc_links)] -#![feature(no_core, lang_items)] +#![deny(rustdoc::broken_intra_doc_links)] +#![feature(no_core, lang_items, rustdoc_internals)] #![no_core] #![crate_type = "rlib"] diff --git a/src/test/rustdoc/intra-doc/prim-methods.rs b/src/test/rustdoc/intra-doc/prim-methods.rs index 076117359d2..a9c5d7d4247 100644 --- a/src/test/rustdoc/intra-doc/prim-methods.rs +++ b/src/test/rustdoc/intra-doc/prim-methods.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] // @has prim_methods/index.html diff --git a/src/test/rustdoc/intra-doc/prim-precedence.rs b/src/test/rustdoc/intra-doc/prim-precedence.rs index fcd86a99f1d..25625b95277 100644 --- a/src/test/rustdoc/intra-doc/prim-precedence.rs +++ b/src/test/rustdoc/intra-doc/prim-precedence.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub mod char { /// [char] diff --git a/src/test/rustdoc/intra-doc/primitive-disambiguators.rs b/src/test/rustdoc/intra-doc/primitive-disambiguators.rs index 9b3b6983240..adcab767d0b 100644 --- a/src/test/rustdoc/intra-doc/primitive-disambiguators.rs +++ b/src/test/rustdoc/intra-doc/primitive-disambiguators.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] // @has primitive_disambiguators/index.html // @has - '//a/@href' '{{channel}}/std/primitive.str.html#method.trim' //! [str::trim()] diff --git a/src/test/rustdoc/intra-doc/primitive-non-default-impl.rs b/src/test/rustdoc/intra-doc/primitive-non-default-impl.rs index f8a824bd08f..474bf347750 100644 --- a/src/test/rustdoc/intra-doc/primitive-non-default-impl.rs +++ b/src/test/rustdoc/intra-doc/primitive-non-default-impl.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] // @has primitive_non_default_impl/fn.str_methods.html diff --git a/src/test/rustdoc/intra-doc/private-failures-ignored.rs b/src/test/rustdoc/intra-doc/private-failures-ignored.rs index cf8bc0b1586..b272bfb5a4d 100644 --- a/src/test/rustdoc/intra-doc/private-failures-ignored.rs +++ b/src/test/rustdoc/intra-doc/private-failures-ignored.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(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] /// ooh, i'm a [rebel] just for kicks struct SomeStruct; diff --git a/src/test/rustdoc/intra-doc/private.rs b/src/test/rustdoc/intra-doc/private.rs index 2756a7998e8..349091e9300 100644 --- a/src/test/rustdoc/intra-doc/private.rs +++ b/src/test/rustdoc/intra-doc/private.rs @@ -1,8 +1,11 @@ -#![crate_name = "private"] // compile-flags: --document-private-items // make sure to update `rustdoc-ui/intra-doc/private.rs` if you update this file +#![allow(rustdoc::private_intra_doc_links)] + +#![crate_name = "private"] + /// docs [DontDocMe] [DontDocMe::f] [DontDocMe::x] // @has private/struct.DocMe.html '//*a[@href="struct.DontDocMe.html"]' 'DontDocMe' // @has private/struct.DocMe.html '//*a[@href="struct.DontDocMe.html#method.f"]' 'DontDocMe::f' diff --git a/src/test/rustdoc/intra-doc/proc-macro.rs b/src/test/rustdoc/intra-doc/proc-macro.rs index fce10a130be..78379a90285 100644 --- a/src/test/rustdoc/intra-doc/proc-macro.rs +++ b/src/test/rustdoc/intra-doc/proc-macro.rs @@ -1,6 +1,6 @@ // aux-build:proc-macro-macro.rs // build-aux-docs -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] extern crate proc_macro_macro; diff --git a/src/test/rustdoc/intra-doc/pub-use.rs b/src/test/rustdoc/intra-doc/pub-use.rs index b4f2d6b0617..0c70cdee914 100644 --- a/src/test/rustdoc/intra-doc/pub-use.rs +++ b/src/test/rustdoc/intra-doc/pub-use.rs @@ -1,5 +1,5 @@ // aux-build: intra-link-pub-use.rs -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] #![crate_name = "outer"] extern crate inner; diff --git a/src/test/rustdoc/intra-doc/raw-ident-self.rs b/src/test/rustdoc/intra-doc/raw-ident-self.rs index 177c3016fb1..1ed33db9300 100644 --- a/src/test/rustdoc/intra-doc/raw-ident-self.rs +++ b/src/test/rustdoc/intra-doc/raw-ident-self.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub mod r#impl { pub struct S; diff --git a/src/test/rustdoc/intra-doc/trait-item.rs b/src/test/rustdoc/intra-doc/trait-item.rs index 0be368d051e..e95dba33b5f 100644 --- a/src/test/rustdoc/intra-doc/trait-item.rs +++ b/src/test/rustdoc/intra-doc/trait-item.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] /// Link to [S::assoc_fn()] /// Link to [Default::default()] diff --git a/src/test/rustdoc/intra-doc/true-false.rs b/src/test/rustdoc/intra-doc/true-false.rs index 44aac688413..be9b3e420b7 100644 --- a/src/test/rustdoc/intra-doc/true-false.rs +++ b/src/test/rustdoc/intra-doc/true-false.rs @@ -1,4 +1,4 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] #![crate_name = "foo"] diff --git a/src/test/rustdoc/intra-doc/type-alias.rs b/src/test/rustdoc/intra-doc/type-alias.rs index f3609ccd0a1..6c52082a277 100644 --- a/src/test/rustdoc/intra-doc/type-alias.rs +++ b/src/test/rustdoc/intra-doc/type-alias.rs @@ -1,6 +1,6 @@ // Regression test for issue #86120. -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] #![crate_name = "foo"] pub struct Foo; diff --git a/src/test/rustdoc/intra-link-prim-self.rs b/src/test/rustdoc/intra-link-prim-self.rs index 8c47f7ef77e..8a564acf2ca 100644 --- a/src/test/rustdoc/intra-link-prim-self.rs +++ b/src/test/rustdoc/intra-link-prim-self.rs @@ -1,6 +1,7 @@ -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] #![feature(lang_items)] #![feature(no_core)] +#![feature(rustdoc_internals)] #![no_core] #[lang = "usize"] diff --git a/src/test/rustdoc/issue-12834.rs b/src/test/rustdoc/issue-12834.rs index 558009e6937..9605a1e78c1 100644 --- a/src/test/rustdoc/issue-12834.rs +++ b/src/test/rustdoc/issue-12834.rs @@ -1,6 +1,7 @@ // Tests that failing to syntax highlight a rust code-block doesn't cause // rustdoc to fail, while still rendering the code-block (without highlighting). +#![allow(rustdoc::invalid_rust_codeblocks)] // @has issue_12834/fn.foo.html // @has - //pre 'a + b ' diff --git a/src/test/rustdoc/issue-15318-3.rs b/src/test/rustdoc/issue-15318-3.rs index 1f7443a6572..2fadc26b006 100644 --- a/src/test/rustdoc/issue-15318-3.rs +++ b/src/test/rustdoc/issue-15318-3.rs @@ -1,3 +1,5 @@ +#![feature(rustdoc_internals)] + // @has issue_15318_3/primitive.pointer.html /// dox diff --git a/src/test/rustdoc/issue-23511.rs b/src/test/rustdoc/issue-23511.rs index 4972a9fb47f..6d421f3c253 100644 --- a/src/test/rustdoc/issue-23511.rs +++ b/src/test/rustdoc/issue-23511.rs @@ -1,4 +1,5 @@ #![feature(lang_items)] +#![feature(rustdoc_internals)] #![no_std] pub mod str { diff --git a/src/test/rustdoc/issue-42760.rs b/src/test/rustdoc/issue-42760.rs index 4944f815701..a5394c7d92a 100644 --- a/src/test/rustdoc/issue-42760.rs +++ b/src/test/rustdoc/issue-42760.rs @@ -1,3 +1,5 @@ +#![allow(rustdoc::invalid_rust_codeblocks)] + // @has issue_42760/struct.NonGen.html // @has - '//h2' 'Example' diff --git a/src/test/rustdoc/issue-43869.rs b/src/test/rustdoc/issue-43869.rs index 44356848fbf..767d09d8558 100644 --- a/src/test/rustdoc/issue-43869.rs +++ b/src/test/rustdoc/issue-43869.rs @@ -2,6 +2,7 @@ pub fn g() -> impl Iterator { Some(1u8).into_iter() } +#[allow(unused_parens)] pub fn h() -> (impl Iterator) { Some(1u8).into_iter() } diff --git a/src/test/rustdoc/link-title-escape.rs b/src/test/rustdoc/link-title-escape.rs index 29e82cba98d..01aa8d00b70 100644 --- a/src/test/rustdoc/link-title-escape.rs +++ b/src/test/rustdoc/link-title-escape.rs @@ -1,3 +1,5 @@ +#![allow(rustdoc::broken_intra_doc_links)] + #![crate_name = "foo"] //! hello [foo] diff --git a/src/test/rustdoc/primitive-generic-impl.rs b/src/test/rustdoc/primitive-generic-impl.rs index 0bf6157fed3..bc689c6ed2f 100644 --- a/src/test/rustdoc/primitive-generic-impl.rs +++ b/src/test/rustdoc/primitive-generic-impl.rs @@ -1,3 +1,5 @@ +#![feature(rustdoc_internals)] + #![crate_name = "foo"] include!("primitive/primitive-generic-impl.rs"); diff --git a/src/test/rustdoc/primitive/primitive-generic-impl.rs b/src/test/rustdoc/primitive/primitive-generic-impl.rs index b9c56be0fcf..63ea1d8e31c 100644 --- a/src/test/rustdoc/primitive/primitive-generic-impl.rs +++ b/src/test/rustdoc/primitive/primitive-generic-impl.rs @@ -1,3 +1,7 @@ +#![feature(rustdoc_internals)] + +// FIXME: this test doesn't test anything + #[doc(primitive = "i32")] /// Some useless docs, wouhou! mod i32 {} diff --git a/src/test/rustdoc/proc-macro.rs b/src/test/rustdoc/proc-macro.rs index f6d1f2cf91b..10acb7ac495 100644 --- a/src/test/rustdoc/proc-macro.rs +++ b/src/test/rustdoc/proc-macro.rs @@ -8,7 +8,7 @@ // @has some_macros/index.html // @has - '//a/[@href="attr.some_proc_attr.html"]' 'some_proc_attr' -//! include a link to [some_proc_macro] to make sure it works. +//! include a link to [some_proc_macro!] to make sure it works. extern crate proc_macro; diff --git a/src/test/rustdoc/range-arg-pattern.rs b/src/test/rustdoc/range-arg-pattern.rs index c08faaad0ec..756939ae377 100644 --- a/src/test/rustdoc/range-arg-pattern.rs +++ b/src/test/rustdoc/range-arg-pattern.rs @@ -2,4 +2,4 @@ // @has foo/fn.f.html // @has - '//*[@class="rust fn"]' 'pub fn f(_: u8)' -pub fn f(0u8...255: u8) {} +pub fn f(0u8..=255: u8) {} diff --git a/src/test/rustdoc/raw-ident-eliminate-r-hashtag.rs b/src/test/rustdoc/raw-ident-eliminate-r-hashtag.rs index ad190361267..7dbe63854f3 100644 --- a/src/test/rustdoc/raw-ident-eliminate-r-hashtag.rs +++ b/src/test/rustdoc/raw-ident-eliminate-r-hashtag.rs @@ -2,6 +2,7 @@ pub mod internal { // @has 'raw_ident_eliminate_r_hashtag/internal/struct.mod.html' + #[allow(non_camel_case_types)] pub struct r#mod; /// See [name], [other name] diff --git a/src/test/rustdoc/sidebar-items.rs b/src/test/rustdoc/sidebar-items.rs index 5da660b4df3..ee670e88b5c 100644 --- a/src/test/rustdoc/sidebar-items.rs +++ b/src/test/rustdoc/sidebar-items.rs @@ -30,11 +30,11 @@ pub struct Bar { // @has foo/enum.En.html // @has - '//*[@class="sidebar-title"]/a[@href="#variants"]' 'Variants' -// @has - '//*[@class="sidebar-links"]/a' 'foo' -// @has - '//*[@class="sidebar-links"]/a' 'bar' +// @has - '//*[@class="sidebar-links"]/a' 'Foo' +// @has - '//*[@class="sidebar-links"]/a' 'Bar' pub enum En { - foo, - bar, + Foo, + Bar, } // @has foo/union.MyUnion.html diff --git a/src/test/rustdoc/titles.rs b/src/test/rustdoc/titles.rs index 2084e851799..016ec7bfaa3 100644 --- a/src/test/rustdoc/titles.rs +++ b/src/test/rustdoc/titles.rs @@ -1,5 +1,7 @@ #![crate_name = "foo"] +#![feature(rustdoc_internals)] + // @matches 'foo/index.html' '//h1' 'Crate foo' // @matches 'foo/foo_mod/index.html' '//h1' 'Module foo::foo_mod'