Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: rename issue-\d+.rs tests to have meaningful names (part 11) #136258

Merged
merged 4 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// https://github.com/rust-lang/rust/issues/28480
#![crate_name="foobar"]

//@ aux-build:rustdoc-hidden-sig.rs
//@ build-aux-docs
//@ ignore-cross-compile
Expand All @@ -7,7 +10,7 @@
//@ has - '//a' 'u8'
extern crate rustdoc_hidden_sig;

//@ has issue_28480/struct.Bar.html
//@ has foobar/struct.Bar.html
//@ !has - '//a/@title' 'Hidden'
//@ has - '//a' 'u8'
pub use rustdoc_hidden_sig::Bar;
Original file line number Diff line number Diff line change
@@ -1,27 +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 issue_31948_1/struct.Wobble.html
//@ 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 issue_31948_1/trait.Bark.html
//@ 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 issue_31948_1/trait.Woof.html
//@ 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 issue_31948_1/trait.Bar.html
//@ !has issue_31948_1/trait.Qux.html
//@ !has foobar/trait.Bar.html
//@ !has foobar/trait.Qux.html
Original file line number Diff line number Diff line change
@@ -1,21 +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 issue_31948_2/struct.Wobble.html
//@ 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 issue_31948_2/trait.Qux.html
//@ 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 issue_31948_2/trait.Bar.html
//@ !has issue_31948_2/trait.Woof.html
//@ !has issue_31948_2/trait.Bark.html
//@ !has foobar/trait.Bar.html
//@ !has foobar/trait.Woof.html
//@ !has foobar/trait.Bark.html
Original file line number Diff line number Diff line change
@@ -1,29 +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 issue_31948/struct.Foo.html
//@ 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 issue_31948/trait.Bark.html
//@ 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 issue_31948/trait.Woof.html
//@ 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 issue_31948/trait.Bar.html
//@ !has issue_31948/trait.Qux.html
//@ !has issue_31948/struct.Wibble.html
//@ !has issue_31948/struct.Wobble.html
//@ !has foobar/trait.Bar.html
//@ !has foobar/trait.Qux.html
//@ !has foobar/struct.Wibble.html
//@ !has foobar/struct.Wobble.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// 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 issue_32881/trait.Bar.html
//@ 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"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +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 issue_33113/trait.Bar.html
//@ has foobar/trait.Bar.html
//@ has - '//h3[@class="code-header"]' "for &'a char"
//@ has - '//h3[@class="code-header"]' "for Foo"
pub use bar::Bar;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://github.com/rust-lang/rust/issues/76736

//@ aux-build:issue-76736-1.rs
//@ aux-build:issue-76736-2.rs

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://github.com/rust-lang/rust/issues/76736

//@ aux-build:issue-76736-1.rs
//@ aux-build:issue-76736-2.rs

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://github.com/rust-lang/rust/issues/76736

//@ aux-build:issue-76736-1.rs
//@ aux-build:issue-76736-2.rs

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/24183
#![crate_type = "lib"]
#![crate_name = "usr"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
//@ !has issue_32343/struct.Foo.html
//@ has issue_32343/index.html
// 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 issue_32343/struct.Bar.html
//@ has issue_32343/index.html
//@ !has foobar/struct.Bar.html
//@ has foobar/index.html
//@ has - '//code' 'pub use foo::Bar'
//@ has - '//code/a' 'Bar'
#[doc(no_inline)]
Expand All @@ -18,6 +21,6 @@ mod foo {
}

pub mod bar {
//@ has issue_32343/bar/struct.Bar.html
//@ has foobar/bar/struct.Bar.html
pub use ::foo::Bar;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// https://github.com/rust-lang/rust/issues/28537
#![crate_name="foo"]

#[doc(hidden)]
pub mod foo {
pub struct Foo;
Expand All @@ -10,8 +13,8 @@ mod bar {
}
}

//@ has issue_28537/struct.Foo.html
//@ has foo/struct.Foo.html
pub use foo::Foo;

//@ has issue_28537/struct.Bar.html
//@ has foo/struct.Bar.html
pub use self::bar::Bar;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://github.com/rust-lang/rust/issues/82209

#![crate_name = "foo"]
#![deny(rustdoc::broken_intra_doc_links)]
pub enum Foo {
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(hah, [#]108459 isn't even an issue but a PR)

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// https://github.com/rust-lang/rust/pull/108459
#![crate_name="foobar"]

#![deny(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::redundant_explicit_links)]

Expand All @@ -13,13 +16,13 @@ pub struct MyStruct1;
// the same target but different text

/// See also [crate::char] and [mod@char] and [prim@char]
//@ has issue_108459/struct.MyStruct2.html '//*[@href="char/index.html"]' 'crate::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 issue_108459/struct.MyStruct3.html '//*[@href="char/index.html"]' '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;
Expand All @@ -28,11 +31,11 @@ pub struct MyStruct3;
// different targets

/// See also [char][mod@char] and [char][prim@char]
//@ has issue_108459/struct.MyStruct4.html '//*[@href="char/index.html"]' '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 issue_108459/struct.MyStruct5.html '//*[@href="char/index.html"]' 'char'
//@ has foobar/struct.MyStruct5.html '//*[@href="char/index.html"]' 'char'
//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char'
pub struct MyStruct5;
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// https://github.com/rust-lang/rust/issues/66159
#![crate_name="foobar"]

//@ aux-crate:priv:pub_struct=pub-struct.rs
//@ compile-flags:-Z unstable-options

Expand All @@ -6,5 +9,5 @@
// Since we don't generate the docs for the auxiliary files, we can't actually
// verify that the struct is linked correctly.

//@ has issue_66159/index.html
//@ has foobar/index.html
//! [pub_struct::SomeStruct]
Loading