From eb457da5cafc0eb907a0ecf70ffae5a37cd4e8f0 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Wed, 29 Jan 2025 11:36:36 -0700 Subject: rustdoc: rename `issue-\d+.rs` tests to have meaningful names --- .../intra-doc/auxiliary/issue-103463-aux.rs | 4 +++ tests/rustdoc-ui/intra-doc/ice-103463.rs | 11 ++++++ tests/rustdoc-ui/intra-doc/ice-104145.rs | 17 +++++++++ .../inline_cross/doc-hidden-broken-link-28480.rs | 16 +++++++++ .../inline_cross/doc-hidden-module-impl-31948-1.rs | 30 ++++++++++++++++ .../inline_cross/doc-hidden-module-impl-31948-2.rs | 24 +++++++++++++ .../inline_cross/doc-hidden-module-impl-31948.rs | 32 +++++++++++++++++ tests/rustdoc/inline_cross/impl-dyn-trait-32881.rs | 14 ++++++++ tests/rustdoc/inline_cross/impl-ref-33113.rs | 13 +++++++ .../issue-24183.method_no_where_self_sized.html | 1 - tests/rustdoc/inline_cross/issue-24183.rs | 19 ---------- tests/rustdoc/inline_cross/issue-28480.rs | 16 --------- tests/rustdoc/inline_cross/issue-31948-1.rs | 30 ---------------- tests/rustdoc/inline_cross/issue-31948-2.rs | 24 ------------- tests/rustdoc/inline_cross/issue-31948.rs | 32 ----------------- tests/rustdoc/inline_cross/issue-32881.rs | 14 -------- tests/rustdoc/inline_cross/issue-33113.rs | 13 ------- tests/rustdoc/inline_cross/issue-76736-1.rs | 17 --------- tests/rustdoc/inline_cross/issue-76736-2.rs | 20 ----------- tests/rustdoc/inline_cross/issue-76736-3.rs | 18 ---------- tests/rustdoc/inline_cross/issue-76736-4.rs | 21 ----------- .../rustdoc/inline_cross/rustc-private-76736-1.rs | 17 +++++++++ .../rustdoc/inline_cross/rustc-private-76736-2.rs | 20 +++++++++++ .../rustdoc/inline_cross/rustc-private-76736-3.rs | 18 ++++++++++ .../rustdoc/inline_cross/rustc-private-76736-4.rs | 21 +++++++++++ ...ed-bounds-24183.method_no_where_self_sized.html | 1 + .../inline_cross/self-sized-bounds-24183.rs | 19 ++++++++++ tests/rustdoc/inline_local/doc-no-inline-32343.rs | 26 ++++++++++++++ tests/rustdoc/inline_local/issue-28537.rs | 20 ----------- tests/rustdoc/inline_local/issue-32343.rs | 26 -------------- tests/rustdoc/inline_local/pub-re-export-28537.rs | 20 +++++++++++ .../intra-doc/auxiliary/issue-103463-aux.rs | 4 --- tests/rustdoc/intra-doc/enum-self-82209.rs | 13 +++++++ tests/rustdoc/intra-doc/issue-103463.rs | 10 ------ tests/rustdoc/intra-doc/issue-104145.rs | 16 --------- tests/rustdoc/intra-doc/issue-108459.rs | 41 ---------------------- tests/rustdoc/intra-doc/issue-66159.rs | 13 ------- tests/rustdoc/intra-doc/issue-82209.rs | 13 ------- ...ink-same-name-different-disambiguator-108459.rs | 41 ++++++++++++++++++++++ .../intra-doc/same-name-different-crates-66159.rs | 13 +++++++ 40 files changed, 370 insertions(+), 368 deletions(-) create mode 100644 tests/rustdoc-ui/intra-doc/auxiliary/issue-103463-aux.rs create mode 100644 tests/rustdoc-ui/intra-doc/ice-103463.rs create mode 100644 tests/rustdoc-ui/intra-doc/ice-104145.rs create mode 100644 tests/rustdoc/inline_cross/doc-hidden-broken-link-28480.rs create mode 100644 tests/rustdoc/inline_cross/doc-hidden-module-impl-31948-1.rs create mode 100644 tests/rustdoc/inline_cross/doc-hidden-module-impl-31948-2.rs create mode 100644 tests/rustdoc/inline_cross/doc-hidden-module-impl-31948.rs create mode 100644 tests/rustdoc/inline_cross/impl-dyn-trait-32881.rs create mode 100644 tests/rustdoc/inline_cross/impl-ref-33113.rs delete mode 100644 tests/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html delete mode 100644 tests/rustdoc/inline_cross/issue-24183.rs delete mode 100644 tests/rustdoc/inline_cross/issue-28480.rs delete mode 100644 tests/rustdoc/inline_cross/issue-31948-1.rs delete mode 100644 tests/rustdoc/inline_cross/issue-31948-2.rs delete mode 100644 tests/rustdoc/inline_cross/issue-31948.rs delete mode 100644 tests/rustdoc/inline_cross/issue-32881.rs delete mode 100644 tests/rustdoc/inline_cross/issue-33113.rs delete mode 100644 tests/rustdoc/inline_cross/issue-76736-1.rs delete mode 100644 tests/rustdoc/inline_cross/issue-76736-2.rs delete mode 100644 tests/rustdoc/inline_cross/issue-76736-3.rs delete mode 100644 tests/rustdoc/inline_cross/issue-76736-4.rs create mode 100644 tests/rustdoc/inline_cross/rustc-private-76736-1.rs create mode 100644 tests/rustdoc/inline_cross/rustc-private-76736-2.rs create mode 100644 tests/rustdoc/inline_cross/rustc-private-76736-3.rs create mode 100644 tests/rustdoc/inline_cross/rustc-private-76736-4.rs create mode 100644 tests/rustdoc/inline_cross/self-sized-bounds-24183.method_no_where_self_sized.html create mode 100644 tests/rustdoc/inline_cross/self-sized-bounds-24183.rs create mode 100644 tests/rustdoc/inline_local/doc-no-inline-32343.rs delete mode 100644 tests/rustdoc/inline_local/issue-28537.rs delete mode 100644 tests/rustdoc/inline_local/issue-32343.rs create mode 100644 tests/rustdoc/inline_local/pub-re-export-28537.rs delete mode 100644 tests/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs create mode 100644 tests/rustdoc/intra-doc/enum-self-82209.rs delete mode 100644 tests/rustdoc/intra-doc/issue-103463.rs delete mode 100644 tests/rustdoc/intra-doc/issue-104145.rs delete mode 100644 tests/rustdoc/intra-doc/issue-108459.rs delete mode 100644 tests/rustdoc/intra-doc/issue-66159.rs delete mode 100644 tests/rustdoc/intra-doc/issue-82209.rs create mode 100644 tests/rustdoc/intra-doc/link-same-name-different-disambiguator-108459.rs create mode 100644 tests/rustdoc/intra-doc/same-name-different-crates-66159.rs diff --git a/tests/rustdoc-ui/intra-doc/auxiliary/issue-103463-aux.rs b/tests/rustdoc-ui/intra-doc/auxiliary/issue-103463-aux.rs new file mode 100644 index 00000000000..2b8fdec1f12 --- /dev/null +++ b/tests/rustdoc-ui/intra-doc/auxiliary/issue-103463-aux.rs @@ -0,0 +1,4 @@ +pub trait Trait { + /// [`u8::clone`] + fn method(); +} diff --git a/tests/rustdoc-ui/intra-doc/ice-103463.rs b/tests/rustdoc-ui/intra-doc/ice-103463.rs new file mode 100644 index 00000000000..10894282e55 --- /dev/null +++ b/tests/rustdoc-ui/intra-doc/ice-103463.rs @@ -0,0 +1,11 @@ +// https://github.com/rust-lang/rust/issues/103463 +//@ check-pass + +// The `Trait` is not pulled into the crate resulting in doc links in its methods being resolved. + +//@ aux-build:issue-103463-aux.rs + +extern crate issue_103463_aux; +use issue_103463_aux::Trait; + +fn main() {} diff --git a/tests/rustdoc-ui/intra-doc/ice-104145.rs b/tests/rustdoc-ui/intra-doc/ice-104145.rs new file mode 100644 index 00000000000..0e403b21c8a --- /dev/null +++ b/tests/rustdoc-ui/intra-doc/ice-104145.rs @@ -0,0 +1,17 @@ +// https://github.com/rust-lang/rust/issues/104145 +//@ check-pass + +// Doc links in `Trait`'s methods are resolved because it has a local impl. + +//@ aux-build:issue-103463-aux.rs + +extern crate issue_103463_aux; +use issue_103463_aux::Trait; + +pub struct LocalType; + +impl Trait for LocalType { + fn method() {} +} + +fn main() {} diff --git a/tests/rustdoc/inline_cross/doc-hidden-broken-link-28480.rs b/tests/rustdoc/inline_cross/doc-hidden-broken-link-28480.rs new file mode 100644 index 00000000000..e1ca7403c03 --- /dev/null +++ b/tests/rustdoc/inline_cross/doc-hidden-broken-link-28480.rs @@ -0,0 +1,16 @@ +// https://github.com/rust-lang/rust/issues/28480 +#![crate_name="foobar"] + +//@ aux-build:rustdoc-hidden-sig.rs +//@ build-aux-docs +//@ ignore-cross-compile + +//@ has rustdoc_hidden_sig/struct.Bar.html +//@ !has - '//a/@title' 'Hidden' +//@ has - '//a' 'u8' +extern crate rustdoc_hidden_sig; + +//@ has foobar/struct.Bar.html +//@ !has - '//a/@title' 'Hidden' +//@ has - '//a' 'u8' +pub use rustdoc_hidden_sig::Bar; diff --git a/tests/rustdoc/inline_cross/doc-hidden-module-impl-31948-1.rs b/tests/rustdoc/inline_cross/doc-hidden-module-impl-31948-1.rs new file mode 100644 index 00000000000..baab1da9547 --- /dev/null +++ b/tests/rustdoc/inline_cross/doc-hidden-module-impl-31948-1.rs @@ -0,0 +1,30 @@ +// https://github.com/rust-lang/rust/issues/31948 +#![crate_name="foobar"] + +//@ aux-build:rustdoc-nonreachable-impls.rs +//@ build-aux-docs +//@ ignore-cross-compile + +extern crate rustdoc_nonreachable_impls; + +//@ has foobar/struct.Wobble.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' +pub use rustdoc_nonreachable_impls::hidden::Wobble; + +//@ has foobar/trait.Bark.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ has - '//h3[@class="code-header"]' 'for Wobble' +//@ !has - '//h3[@class="code-header"]' 'for Wibble' +pub use rustdoc_nonreachable_impls::Bark; + +//@ has foobar/trait.Woof.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ has - '//h3[@class="code-header"]' 'for Wobble' +//@ !has - '//h3[@class="code-header"]' 'for Wibble' +pub use rustdoc_nonreachable_impls::Woof; + +//@ !has foobar/trait.Bar.html +//@ !has foobar/trait.Qux.html diff --git a/tests/rustdoc/inline_cross/doc-hidden-module-impl-31948-2.rs b/tests/rustdoc/inline_cross/doc-hidden-module-impl-31948-2.rs new file mode 100644 index 00000000000..40e9108ec62 --- /dev/null +++ b/tests/rustdoc/inline_cross/doc-hidden-module-impl-31948-2.rs @@ -0,0 +1,24 @@ +// https://github.com/rust-lang/rust/issues/31948 +#![crate_name="foobar"] + +//@ aux-build:rustdoc-nonreachable-impls.rs +//@ build-aux-docs +//@ ignore-cross-compile + +extern crate rustdoc_nonreachable_impls; + +//@ has foobar/struct.Wobble.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' +pub use rustdoc_nonreachable_impls::hidden::Wobble; + +//@ has foobar/trait.Qux.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ has - '//h3[@class="code-header"]' 'for Wobble' +pub use rustdoc_nonreachable_impls::hidden::Qux; + +//@ !has foobar/trait.Bar.html +//@ !has foobar/trait.Woof.html +//@ !has foobar/trait.Bark.html diff --git a/tests/rustdoc/inline_cross/doc-hidden-module-impl-31948.rs b/tests/rustdoc/inline_cross/doc-hidden-module-impl-31948.rs new file mode 100644 index 00000000000..ab0048513c7 --- /dev/null +++ b/tests/rustdoc/inline_cross/doc-hidden-module-impl-31948.rs @@ -0,0 +1,32 @@ +// https://github.com/rust-lang/rust/issues/31948 +#![crate_name="foobar"] + +//@ aux-build:rustdoc-nonreachable-impls.rs +//@ build-aux-docs +//@ ignore-cross-compile + +extern crate rustdoc_nonreachable_impls; + +//@ has foobar/struct.Foo.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' +pub use rustdoc_nonreachable_impls::Foo; + +//@ has foobar/trait.Bark.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ !has - '//h3[@class="code-header"]' 'for Wibble' +//@ !has - '//h3[@class="code-header"]' 'for Wobble' +pub use rustdoc_nonreachable_impls::Bark; + +//@ has foobar/trait.Woof.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ !has - '//h3[@class="code-header"]' 'for Wibble' +//@ !has - '//h3[@class="code-header"]' 'for Wobble' +pub use rustdoc_nonreachable_impls::Woof; + +//@ !has foobar/trait.Bar.html +//@ !has foobar/trait.Qux.html +//@ !has foobar/struct.Wibble.html +//@ !has foobar/struct.Wobble.html diff --git a/tests/rustdoc/inline_cross/impl-dyn-trait-32881.rs b/tests/rustdoc/inline_cross/impl-dyn-trait-32881.rs new file mode 100644 index 00000000000..f7dc7414455 --- /dev/null +++ b/tests/rustdoc/inline_cross/impl-dyn-trait-32881.rs @@ -0,0 +1,14 @@ +// https://github.com/rust-lang/rust/issues/32881 +#![crate_name="foobar"] + +//@ aux-build:rustdoc-trait-object-impl.rs +//@ build-aux-docs +//@ ignore-cross-compile + +extern crate rustdoc_trait_object_impl; + +//@ has foobar/trait.Bar.html +//@ has - '//h3[@class="code-header"]' "impl<'a> dyn Bar" +//@ has - '//h3[@class="code-header"]' "impl<'a> Debug for dyn Bar" + +pub use rustdoc_trait_object_impl::Bar; diff --git a/tests/rustdoc/inline_cross/impl-ref-33113.rs b/tests/rustdoc/inline_cross/impl-ref-33113.rs new file mode 100644 index 00000000000..9ac4f02e00c --- /dev/null +++ b/tests/rustdoc/inline_cross/impl-ref-33113.rs @@ -0,0 +1,13 @@ +// https://github.com/rust-lang/rust/issues/33113 +#![crate_name="foobar"] + +//@ aux-build:issue-33113.rs +//@ build-aux-docs +//@ ignore-cross-compile + +extern crate bar; + +//@ has foobar/trait.Bar.html +//@ has - '//h3[@class="code-header"]' "for &'a char" +//@ has - '//h3[@class="code-header"]' "for Foo" +pub use bar::Bar; diff --git a/tests/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html b/tests/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html deleted file mode 100644 index f3c1c045202..00000000000 --- a/tests/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html +++ /dev/null @@ -1 +0,0 @@ -

fn touch(&self)

\ No newline at end of file diff --git a/tests/rustdoc/inline_cross/issue-24183.rs b/tests/rustdoc/inline_cross/issue-24183.rs deleted file mode 100644 index 909005532f5..00000000000 --- a/tests/rustdoc/inline_cross/issue-24183.rs +++ /dev/null @@ -1,19 +0,0 @@ -// https://github.com/rust-lang/rust/issues/24183 -#![crate_type = "lib"] -#![crate_name = "usr"] - -//@ aux-crate:issue_24183=issue-24183.rs -//@ edition: 2021 - -//@ has usr/trait.U.html -//@ has - '//*[@class="rust item-decl"]' "pub trait U {" -//@ has - '//*[@id="method.modified"]' \ -// "fn modified(self) -> Self\ -// where \ -// Self: Sized" -//@ snapshot method_no_where_self_sized - '//*[@id="method.touch"]/*[@class="code-header"]' -pub use issue_24183::U; - -//@ has usr/trait.S.html -//@ has - '//*[@class="rust item-decl"]' 'pub trait S: Sized {' -pub use issue_24183::S; diff --git a/tests/rustdoc/inline_cross/issue-28480.rs b/tests/rustdoc/inline_cross/issue-28480.rs deleted file mode 100644 index e1ca7403c03..00000000000 --- a/tests/rustdoc/inline_cross/issue-28480.rs +++ /dev/null @@ -1,16 +0,0 @@ -// https://github.com/rust-lang/rust/issues/28480 -#![crate_name="foobar"] - -//@ aux-build:rustdoc-hidden-sig.rs -//@ build-aux-docs -//@ ignore-cross-compile - -//@ has rustdoc_hidden_sig/struct.Bar.html -//@ !has - '//a/@title' 'Hidden' -//@ has - '//a' 'u8' -extern crate rustdoc_hidden_sig; - -//@ has foobar/struct.Bar.html -//@ !has - '//a/@title' 'Hidden' -//@ has - '//a' 'u8' -pub use rustdoc_hidden_sig::Bar; diff --git a/tests/rustdoc/inline_cross/issue-31948-1.rs b/tests/rustdoc/inline_cross/issue-31948-1.rs deleted file mode 100644 index baab1da9547..00000000000 --- a/tests/rustdoc/inline_cross/issue-31948-1.rs +++ /dev/null @@ -1,30 +0,0 @@ -// https://github.com/rust-lang/rust/issues/31948 -#![crate_name="foobar"] - -//@ aux-build:rustdoc-nonreachable-impls.rs -//@ build-aux-docs -//@ ignore-cross-compile - -extern crate rustdoc_nonreachable_impls; - -//@ has foobar/struct.Wobble.html -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' -//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' -//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' -pub use rustdoc_nonreachable_impls::hidden::Wobble; - -//@ has foobar/trait.Bark.html -//@ has - '//h3[@class="code-header"]' 'for Foo' -//@ has - '//h3[@class="code-header"]' 'for Wobble' -//@ !has - '//h3[@class="code-header"]' 'for Wibble' -pub use rustdoc_nonreachable_impls::Bark; - -//@ has foobar/trait.Woof.html -//@ has - '//h3[@class="code-header"]' 'for Foo' -//@ has - '//h3[@class="code-header"]' 'for Wobble' -//@ !has - '//h3[@class="code-header"]' 'for Wibble' -pub use rustdoc_nonreachable_impls::Woof; - -//@ !has foobar/trait.Bar.html -//@ !has foobar/trait.Qux.html diff --git a/tests/rustdoc/inline_cross/issue-31948-2.rs b/tests/rustdoc/inline_cross/issue-31948-2.rs deleted file mode 100644 index 40e9108ec62..00000000000 --- a/tests/rustdoc/inline_cross/issue-31948-2.rs +++ /dev/null @@ -1,24 +0,0 @@ -// https://github.com/rust-lang/rust/issues/31948 -#![crate_name="foobar"] - -//@ aux-build:rustdoc-nonreachable-impls.rs -//@ build-aux-docs -//@ ignore-cross-compile - -extern crate rustdoc_nonreachable_impls; - -//@ has foobar/struct.Wobble.html -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' -//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' -pub use rustdoc_nonreachable_impls::hidden::Wobble; - -//@ has foobar/trait.Qux.html -//@ has - '//h3[@class="code-header"]' 'for Foo' -//@ has - '//h3[@class="code-header"]' 'for Wobble' -pub use rustdoc_nonreachable_impls::hidden::Qux; - -//@ !has foobar/trait.Bar.html -//@ !has foobar/trait.Woof.html -//@ !has foobar/trait.Bark.html diff --git a/tests/rustdoc/inline_cross/issue-31948.rs b/tests/rustdoc/inline_cross/issue-31948.rs deleted file mode 100644 index ab0048513c7..00000000000 --- a/tests/rustdoc/inline_cross/issue-31948.rs +++ /dev/null @@ -1,32 +0,0 @@ -// https://github.com/rust-lang/rust/issues/31948 -#![crate_name="foobar"] - -//@ aux-build:rustdoc-nonreachable-impls.rs -//@ build-aux-docs -//@ ignore-cross-compile - -extern crate rustdoc_nonreachable_impls; - -//@ has foobar/struct.Foo.html -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' -//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' -//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' -pub use rustdoc_nonreachable_impls::Foo; - -//@ has foobar/trait.Bark.html -//@ has - '//h3[@class="code-header"]' 'for Foo' -//@ !has - '//h3[@class="code-header"]' 'for Wibble' -//@ !has - '//h3[@class="code-header"]' 'for Wobble' -pub use rustdoc_nonreachable_impls::Bark; - -//@ has foobar/trait.Woof.html -//@ has - '//h3[@class="code-header"]' 'for Foo' -//@ !has - '//h3[@class="code-header"]' 'for Wibble' -//@ !has - '//h3[@class="code-header"]' 'for Wobble' -pub use rustdoc_nonreachable_impls::Woof; - -//@ !has foobar/trait.Bar.html -//@ !has foobar/trait.Qux.html -//@ !has foobar/struct.Wibble.html -//@ !has foobar/struct.Wobble.html diff --git a/tests/rustdoc/inline_cross/issue-32881.rs b/tests/rustdoc/inline_cross/issue-32881.rs deleted file mode 100644 index f7dc7414455..00000000000 --- a/tests/rustdoc/inline_cross/issue-32881.rs +++ /dev/null @@ -1,14 +0,0 @@ -// https://github.com/rust-lang/rust/issues/32881 -#![crate_name="foobar"] - -//@ aux-build:rustdoc-trait-object-impl.rs -//@ build-aux-docs -//@ ignore-cross-compile - -extern crate rustdoc_trait_object_impl; - -//@ has foobar/trait.Bar.html -//@ has - '//h3[@class="code-header"]' "impl<'a> dyn Bar" -//@ has - '//h3[@class="code-header"]' "impl<'a> Debug for dyn Bar" - -pub use rustdoc_trait_object_impl::Bar; diff --git a/tests/rustdoc/inline_cross/issue-33113.rs b/tests/rustdoc/inline_cross/issue-33113.rs deleted file mode 100644 index 9ac4f02e00c..00000000000 --- a/tests/rustdoc/inline_cross/issue-33113.rs +++ /dev/null @@ -1,13 +0,0 @@ -// https://github.com/rust-lang/rust/issues/33113 -#![crate_name="foobar"] - -//@ aux-build:issue-33113.rs -//@ build-aux-docs -//@ ignore-cross-compile - -extern crate bar; - -//@ has foobar/trait.Bar.html -//@ has - '//h3[@class="code-header"]' "for &'a char" -//@ has - '//h3[@class="code-header"]' "for Foo" -pub use bar::Bar; diff --git a/tests/rustdoc/inline_cross/issue-76736-1.rs b/tests/rustdoc/inline_cross/issue-76736-1.rs deleted file mode 100644 index 3ffa5e6cc06..00000000000 --- a/tests/rustdoc/inline_cross/issue-76736-1.rs +++ /dev/null @@ -1,17 +0,0 @@ -// https://github.com/rust-lang/rust/issues/76736 - -//@ aux-build:issue-76736-1.rs -//@ aux-build:issue-76736-2.rs - -#![crate_name = "foo"] - -extern crate issue_76736_1; -extern crate issue_76736_2; - -//@ has foo/struct.Foo.html -//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' -pub struct Foo; - -//@ has foo/struct.Bar.html -//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' -pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/issue-76736-2.rs b/tests/rustdoc/inline_cross/issue-76736-2.rs deleted file mode 100644 index 843b2941602..00000000000 --- a/tests/rustdoc/inline_cross/issue-76736-2.rs +++ /dev/null @@ -1,20 +0,0 @@ -// https://github.com/rust-lang/rust/issues/76736 - -//@ aux-build:issue-76736-1.rs -//@ aux-build:issue-76736-2.rs - -// https://github.com/rust-lang/rust/issues/124635 - -#![crate_name = "foo"] -#![feature(rustc_private)] - -extern crate issue_76736_1; -extern crate issue_76736_2; - -//@ has foo/struct.Foo.html -//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' -pub struct Foo; - -//@ has foo/struct.Bar.html -//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' -pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/issue-76736-3.rs b/tests/rustdoc/inline_cross/issue-76736-3.rs deleted file mode 100644 index f9b46caa02f..00000000000 --- a/tests/rustdoc/inline_cross/issue-76736-3.rs +++ /dev/null @@ -1,18 +0,0 @@ -// https://github.com/rust-lang/rust/issues/76736 - -//@ compile-flags: -Zforce-unstable-if-unmarked -//@ aux-build:issue-76736-1.rs -//@ aux-build:issue-76736-2.rs - -#![crate_name = "foo"] - -extern crate issue_76736_1; -extern crate issue_76736_2; - -//@ has foo/struct.Foo.html -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' -pub struct Foo; - -//@ has foo/struct.Bar.html -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' -pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/issue-76736-4.rs b/tests/rustdoc/inline_cross/issue-76736-4.rs deleted file mode 100644 index 511464f2c49..00000000000 --- a/tests/rustdoc/inline_cross/issue-76736-4.rs +++ /dev/null @@ -1,21 +0,0 @@ -// https://github.com/rust-lang/rust/issues/76736 - -//@ aux-build:issue-76736-1.rs -//@ aux-build:issue-76736-2.rs - -// https://github.com/rust-lang/rust/issues/124635 - -#![crate_name = "foo"] -#![feature(rustc_private, staged_api)] -#![unstable(feature = "rustc_private", issue = "none")] - -extern crate issue_76736_1; -extern crate issue_76736_2; - -//@ has foo/struct.Foo.html -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' -pub struct Foo; - -//@ has foo/struct.Bar.html -//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' -pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/rustc-private-76736-1.rs b/tests/rustdoc/inline_cross/rustc-private-76736-1.rs new file mode 100644 index 00000000000..3ffa5e6cc06 --- /dev/null +++ b/tests/rustdoc/inline_cross/rustc-private-76736-1.rs @@ -0,0 +1,17 @@ +// https://github.com/rust-lang/rust/issues/76736 + +//@ aux-build:issue-76736-1.rs +//@ aux-build:issue-76736-2.rs + +#![crate_name = "foo"] + +extern crate issue_76736_1; +extern crate issue_76736_2; + +//@ has foo/struct.Foo.html +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +pub struct Foo; + +//@ has foo/struct.Bar.html +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/rustc-private-76736-2.rs b/tests/rustdoc/inline_cross/rustc-private-76736-2.rs new file mode 100644 index 00000000000..843b2941602 --- /dev/null +++ b/tests/rustdoc/inline_cross/rustc-private-76736-2.rs @@ -0,0 +1,20 @@ +// https://github.com/rust-lang/rust/issues/76736 + +//@ aux-build:issue-76736-1.rs +//@ aux-build:issue-76736-2.rs + +// https://github.com/rust-lang/rust/issues/124635 + +#![crate_name = "foo"] +#![feature(rustc_private)] + +extern crate issue_76736_1; +extern crate issue_76736_2; + +//@ has foo/struct.Foo.html +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +pub struct Foo; + +//@ has foo/struct.Bar.html +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/rustc-private-76736-3.rs b/tests/rustdoc/inline_cross/rustc-private-76736-3.rs new file mode 100644 index 00000000000..f9b46caa02f --- /dev/null +++ b/tests/rustdoc/inline_cross/rustc-private-76736-3.rs @@ -0,0 +1,18 @@ +// https://github.com/rust-lang/rust/issues/76736 + +//@ compile-flags: -Zforce-unstable-if-unmarked +//@ aux-build:issue-76736-1.rs +//@ aux-build:issue-76736-2.rs + +#![crate_name = "foo"] + +extern crate issue_76736_1; +extern crate issue_76736_2; + +//@ has foo/struct.Foo.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +pub struct Foo; + +//@ has foo/struct.Bar.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/rustc-private-76736-4.rs b/tests/rustdoc/inline_cross/rustc-private-76736-4.rs new file mode 100644 index 00000000000..511464f2c49 --- /dev/null +++ b/tests/rustdoc/inline_cross/rustc-private-76736-4.rs @@ -0,0 +1,21 @@ +// https://github.com/rust-lang/rust/issues/76736 + +//@ aux-build:issue-76736-1.rs +//@ aux-build:issue-76736-2.rs + +// https://github.com/rust-lang/rust/issues/124635 + +#![crate_name = "foo"] +#![feature(rustc_private, staged_api)] +#![unstable(feature = "rustc_private", issue = "none")] + +extern crate issue_76736_1; +extern crate issue_76736_2; + +//@ has foo/struct.Foo.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +pub struct Foo; + +//@ has foo/struct.Bar.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/self-sized-bounds-24183.method_no_where_self_sized.html b/tests/rustdoc/inline_cross/self-sized-bounds-24183.method_no_where_self_sized.html new file mode 100644 index 00000000000..f3c1c045202 --- /dev/null +++ b/tests/rustdoc/inline_cross/self-sized-bounds-24183.method_no_where_self_sized.html @@ -0,0 +1 @@ +

fn touch(&self)

\ No newline at end of file diff --git a/tests/rustdoc/inline_cross/self-sized-bounds-24183.rs b/tests/rustdoc/inline_cross/self-sized-bounds-24183.rs new file mode 100644 index 00000000000..909005532f5 --- /dev/null +++ b/tests/rustdoc/inline_cross/self-sized-bounds-24183.rs @@ -0,0 +1,19 @@ +// https://github.com/rust-lang/rust/issues/24183 +#![crate_type = "lib"] +#![crate_name = "usr"] + +//@ aux-crate:issue_24183=issue-24183.rs +//@ edition: 2021 + +//@ has usr/trait.U.html +//@ has - '//*[@class="rust item-decl"]' "pub trait U {" +//@ has - '//*[@id="method.modified"]' \ +// "fn modified(self) -> Self\ +// where \ +// Self: Sized" +//@ snapshot method_no_where_self_sized - '//*[@id="method.touch"]/*[@class="code-header"]' +pub use issue_24183::U; + +//@ has usr/trait.S.html +//@ has - '//*[@class="rust item-decl"]' 'pub trait S: Sized {' +pub use issue_24183::S; diff --git a/tests/rustdoc/inline_local/doc-no-inline-32343.rs b/tests/rustdoc/inline_local/doc-no-inline-32343.rs new file mode 100644 index 00000000000..ed11614a500 --- /dev/null +++ b/tests/rustdoc/inline_local/doc-no-inline-32343.rs @@ -0,0 +1,26 @@ +// https://github.com/rust-lang/rust/issues/32343 +#![crate_name="foobar"] + +//@ !has foobar/struct.Foo.html +//@ has foobar/index.html +//@ has - '//code' 'pub use foo::Foo' +//@ !has - '//code/a' 'Foo' +#[doc(no_inline)] +pub use foo::Foo; + +//@ !has foobar/struct.Bar.html +//@ has foobar/index.html +//@ has - '//code' 'pub use foo::Bar' +//@ has - '//code/a' 'Bar' +#[doc(no_inline)] +pub use foo::Bar; + +mod foo { + pub struct Foo; + pub struct Bar; +} + +pub mod bar { + //@ has foobar/bar/struct.Bar.html + pub use ::foo::Bar; +} diff --git a/tests/rustdoc/inline_local/issue-28537.rs b/tests/rustdoc/inline_local/issue-28537.rs deleted file mode 100644 index 0e9836c7cee..00000000000 --- a/tests/rustdoc/inline_local/issue-28537.rs +++ /dev/null @@ -1,20 +0,0 @@ -// https://github.com/rust-lang/rust/issues/28537 -#![crate_name="foo"] - -#[doc(hidden)] -pub mod foo { - pub struct Foo; -} - -mod bar { - pub use self::bar::Bar; - mod bar { - pub struct Bar; - } -} - -//@ has foo/struct.Foo.html -pub use foo::Foo; - -//@ has foo/struct.Bar.html -pub use self::bar::Bar; diff --git a/tests/rustdoc/inline_local/issue-32343.rs b/tests/rustdoc/inline_local/issue-32343.rs deleted file mode 100644 index ed11614a500..00000000000 --- a/tests/rustdoc/inline_local/issue-32343.rs +++ /dev/null @@ -1,26 +0,0 @@ -// https://github.com/rust-lang/rust/issues/32343 -#![crate_name="foobar"] - -//@ !has foobar/struct.Foo.html -//@ has foobar/index.html -//@ has - '//code' 'pub use foo::Foo' -//@ !has - '//code/a' 'Foo' -#[doc(no_inline)] -pub use foo::Foo; - -//@ !has foobar/struct.Bar.html -//@ has foobar/index.html -//@ has - '//code' 'pub use foo::Bar' -//@ has - '//code/a' 'Bar' -#[doc(no_inline)] -pub use foo::Bar; - -mod foo { - pub struct Foo; - pub struct Bar; -} - -pub mod bar { - //@ has foobar/bar/struct.Bar.html - pub use ::foo::Bar; -} diff --git a/tests/rustdoc/inline_local/pub-re-export-28537.rs b/tests/rustdoc/inline_local/pub-re-export-28537.rs new file mode 100644 index 00000000000..0e9836c7cee --- /dev/null +++ b/tests/rustdoc/inline_local/pub-re-export-28537.rs @@ -0,0 +1,20 @@ +// https://github.com/rust-lang/rust/issues/28537 +#![crate_name="foo"] + +#[doc(hidden)] +pub mod foo { + pub struct Foo; +} + +mod bar { + pub use self::bar::Bar; + mod bar { + pub struct Bar; + } +} + +//@ has foo/struct.Foo.html +pub use foo::Foo; + +//@ has foo/struct.Bar.html +pub use self::bar::Bar; diff --git a/tests/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs b/tests/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs deleted file mode 100644 index 2b8fdec1f12..00000000000 --- a/tests/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub trait Trait { - /// [`u8::clone`] - fn method(); -} diff --git a/tests/rustdoc/intra-doc/enum-self-82209.rs b/tests/rustdoc/intra-doc/enum-self-82209.rs new file mode 100644 index 00000000000..615115a5f8b --- /dev/null +++ b/tests/rustdoc/intra-doc/enum-self-82209.rs @@ -0,0 +1,13 @@ +// https://github.com/rust-lang/rust/issues/82209 + +#![crate_name = "foo"] +#![deny(rustdoc::broken_intra_doc_links)] +pub enum Foo { + Bar { + abc: i32, + /// [Self::Bar::abc] + xyz: i32, + }, +} + +//@ has foo/enum.Foo.html '//a/@href' 'enum.Foo.html#variant.Bar.field.abc' diff --git a/tests/rustdoc/intra-doc/issue-103463.rs b/tests/rustdoc/intra-doc/issue-103463.rs deleted file mode 100644 index bfe5c4f05d4..00000000000 --- a/tests/rustdoc/intra-doc/issue-103463.rs +++ /dev/null @@ -1,10 +0,0 @@ -// https://github.com/rust-lang/rust/issues/103463 - -// The `Trait` is not pulled into the crate resulting in doc links in its methods being resolved. - -//@ aux-build:issue-103463-aux.rs - -extern crate issue_103463_aux; -use issue_103463_aux::Trait; - -fn main() {} diff --git a/tests/rustdoc/intra-doc/issue-104145.rs b/tests/rustdoc/intra-doc/issue-104145.rs deleted file mode 100644 index 92c7fa31b4f..00000000000 --- a/tests/rustdoc/intra-doc/issue-104145.rs +++ /dev/null @@ -1,16 +0,0 @@ -// https://github.com/rust-lang/rust/issues/104145 - -// Doc links in `Trait`'s methods are resolved because it has a local impl. - -//@ aux-build:issue-103463-aux.rs - -extern crate issue_103463_aux; -use issue_103463_aux::Trait; - -pub struct LocalType; - -impl Trait for LocalType { - fn method() {} -} - -fn main() {} diff --git a/tests/rustdoc/intra-doc/issue-108459.rs b/tests/rustdoc/intra-doc/issue-108459.rs deleted file mode 100644 index 0328e6435a5..00000000000 --- a/tests/rustdoc/intra-doc/issue-108459.rs +++ /dev/null @@ -1,41 +0,0 @@ -// https://github.com/rust-lang/rust/issues/108459 -#![crate_name="foobar"] - -#![deny(rustdoc::broken_intra_doc_links)] -#![allow(rustdoc::redundant_explicit_links)] - -pub struct S; -pub mod char {} - -// Ensure this doesn't ICE due to trying to slice off non-existent backticks from "S" - -/// See [S] and [`S`] -pub struct MyStruct1; - -// Ensure that link texts are replaced correctly even if there are multiple links with -// the same target but different text - -/// See also [crate::char] and [mod@char] and [prim@char] -//@ has foobar/struct.MyStruct2.html '//*[@href="char/index.html"]' 'crate::char' -//@ has - '//*[@href="char/index.html"]' 'char' -//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' -pub struct MyStruct2; - -/// See also [mod@char] and [prim@char] and [crate::char] -//@ has foobar/struct.MyStruct3.html '//*[@href="char/index.html"]' 'crate::char' -//@ has - '//*[@href="char/index.html"]' 'char' -//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' -pub struct MyStruct3; - -// Ensure that links are correct even if there are multiple links with the same text but -// different targets - -/// See also [char][mod@char] and [char][prim@char] -//@ has foobar/struct.MyStruct4.html '//*[@href="char/index.html"]' 'char' -//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' -pub struct MyStruct4; - -/// See also [char][prim@char] and [char][crate::char] -//@ has foobar/struct.MyStruct5.html '//*[@href="char/index.html"]' 'char' -//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' -pub struct MyStruct5; diff --git a/tests/rustdoc/intra-doc/issue-66159.rs b/tests/rustdoc/intra-doc/issue-66159.rs deleted file mode 100644 index 7e3ace9355a..00000000000 --- a/tests/rustdoc/intra-doc/issue-66159.rs +++ /dev/null @@ -1,13 +0,0 @@ -// https://github.com/rust-lang/rust/issues/66159 -#![crate_name="foobar"] - -//@ aux-crate:priv:pub_struct=pub-struct.rs -//@ compile-flags:-Z unstable-options - -// The issue was an ICE which meant that we never actually generated the docs -// so if we have generated the docs, we're okay. -// Since we don't generate the docs for the auxiliary files, we can't actually -// verify that the struct is linked correctly. - -//@ has foobar/index.html -//! [pub_struct::SomeStruct] diff --git a/tests/rustdoc/intra-doc/issue-82209.rs b/tests/rustdoc/intra-doc/issue-82209.rs deleted file mode 100644 index 615115a5f8b..00000000000 --- a/tests/rustdoc/intra-doc/issue-82209.rs +++ /dev/null @@ -1,13 +0,0 @@ -// https://github.com/rust-lang/rust/issues/82209 - -#![crate_name = "foo"] -#![deny(rustdoc::broken_intra_doc_links)] -pub enum Foo { - Bar { - abc: i32, - /// [Self::Bar::abc] - xyz: i32, - }, -} - -//@ has foo/enum.Foo.html '//a/@href' 'enum.Foo.html#variant.Bar.field.abc' diff --git a/tests/rustdoc/intra-doc/link-same-name-different-disambiguator-108459.rs b/tests/rustdoc/intra-doc/link-same-name-different-disambiguator-108459.rs new file mode 100644 index 00000000000..0328e6435a5 --- /dev/null +++ b/tests/rustdoc/intra-doc/link-same-name-different-disambiguator-108459.rs @@ -0,0 +1,41 @@ +// https://github.com/rust-lang/rust/issues/108459 +#![crate_name="foobar"] + +#![deny(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::redundant_explicit_links)] + +pub struct S; +pub mod char {} + +// Ensure this doesn't ICE due to trying to slice off non-existent backticks from "S" + +/// See [S] and [`S`] +pub struct MyStruct1; + +// Ensure that link texts are replaced correctly even if there are multiple links with +// the same target but different text + +/// See also [crate::char] and [mod@char] and [prim@char] +//@ has foobar/struct.MyStruct2.html '//*[@href="char/index.html"]' 'crate::char' +//@ has - '//*[@href="char/index.html"]' 'char' +//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' +pub struct MyStruct2; + +/// See also [mod@char] and [prim@char] and [crate::char] +//@ has foobar/struct.MyStruct3.html '//*[@href="char/index.html"]' 'crate::char' +//@ has - '//*[@href="char/index.html"]' 'char' +//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' +pub struct MyStruct3; + +// Ensure that links are correct even if there are multiple links with the same text but +// different targets + +/// See also [char][mod@char] and [char][prim@char] +//@ has foobar/struct.MyStruct4.html '//*[@href="char/index.html"]' 'char' +//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' +pub struct MyStruct4; + +/// See also [char][prim@char] and [char][crate::char] +//@ has foobar/struct.MyStruct5.html '//*[@href="char/index.html"]' 'char' +//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' +pub struct MyStruct5; diff --git a/tests/rustdoc/intra-doc/same-name-different-crates-66159.rs b/tests/rustdoc/intra-doc/same-name-different-crates-66159.rs new file mode 100644 index 00000000000..7e3ace9355a --- /dev/null +++ b/tests/rustdoc/intra-doc/same-name-different-crates-66159.rs @@ -0,0 +1,13 @@ +// https://github.com/rust-lang/rust/issues/66159 +#![crate_name="foobar"] + +//@ aux-crate:priv:pub_struct=pub-struct.rs +//@ compile-flags:-Z unstable-options + +// The issue was an ICE which meant that we never actually generated the docs +// so if we have generated the docs, we're okay. +// Since we don't generate the docs for the auxiliary files, we can't actually +// verify that the struct is linked correctly. + +//@ has foobar/index.html +//! [pub_struct::SomeStruct] -- cgit 1.4.1-3-g733a5