Skip to content

Commit

Permalink
Rollup merge of rust-lang#123574 - notriddle:notriddle/issue-d, r=fmease
Browse files Browse the repository at this point in the history
rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 6)

Follow up

* rust-lang#116214
* rust-lang#116432
* rust-lang#116824
* rust-lang#118105
* rust-lang#119561
  • Loading branch information
GuillaumeGomez authored Apr 16, 2024
2 parents ea7eb71 + ecbe327 commit e7c13c3
Show file tree
Hide file tree
Showing 24 changed files with 69 additions and 33 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//@ check-pass
// This shouldn't cause a stack overflow when rustdoc is run
// https://github.com/rust-lang/rust/issues/56701

use std::ops::Deref;
use std::ops::DerefMut;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Regression test for ICE #73061
// Regression test for ICE https://github.com/rust-lang/rust/issues/73061

//@ check-pass
//@ aux-build:issue-73061.rs

extern crate issue_73061;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/78673
#![crate_name = "issue_78673"]

pub trait Something {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// @has 'issue_76501/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32'
// https://github.com/rust-lang/rust/issues/76501
#![crate_name="foo"]

// @has 'foo/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32'
/// A useless function that always returns 1.
pub const fn bloop() -> i32 {
1
Expand All @@ -8,7 +11,7 @@ pub const fn bloop() -> i32 {
pub struct Struct {}

impl Struct {
// @has 'issue_76501/struct.Struct.html' '//*[@class="method"]' \
// @has 'foo/struct.Struct.html' '//*[@class="method"]' \
// 'pub const fn blurp() -> i32'
/// A useless function that always returns 1.
pub const fn blurp() -> i32 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// https://github.com/rust-lang/rust/issues/79201
#![crate_name="foo"]

#![feature(doc_cfg)]

// @has 'issue_79201/trait.Foo.html'
// @has 'foo/trait.Foo.html'
// @count - '//*[@class="stab portability"]' 6
// @matches - '//*[@class="stab portability"]' 'crate feature foo-root'
// @matches - '//*[@class="stab portability"]' 'crate feature foo-public-mod'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//@ compile-flags: -Zunstable-options --document-private-items --document-hidden-items
// https://github.com/rust-lang/rust/issues/67851
#![crate_name="foo"]

// @has issue_67851_both/struct.Hidden.html
// @has foo/struct.Hidden.html
#[doc(hidden)]
pub struct Hidden;

// @has issue_67851_both/struct.Private.html
// @has foo/struct.Private.html
struct Private;
10 changes: 10 additions & 0 deletions tests/rustdoc/doc-hidden-private-67851-hidden.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ compile-flags: -Zunstable-options --document-hidden-items
// https://github.com/rust-lang/rust/issues/67851
#![crate_name="foo"]

// @has foo/struct.Hidden.html
#[doc(hidden)]
pub struct Hidden;

// @!has foo/struct.Private.html
struct Private;
9 changes: 9 additions & 0 deletions tests/rustdoc/doc-hidden-private-67851-neither.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// https://github.com/rust-lang/rust/issues/67851
#![crate_name="foo"]

// @!has foo/struct.Hidden.html
#[doc(hidden)]
pub struct Hidden;

// @!has foo/struct.Private.html
struct Private;
10 changes: 10 additions & 0 deletions tests/rustdoc/doc-hidden-private-67851-private.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ compile-flags: --document-private-items
// https://github.com/rust-lang/rust/issues/67851
#![crate_name="foo"]

// @!has foo/struct.Hidden.html
#[doc(hidden)]
pub struct Hidden;

// @has foo/struct.Private.html
struct Private;
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// https://github.com/rust-lang/rust/issues/74083
#![crate_name="foo"]

use std::ops::Deref;

pub struct Foo;
Expand All @@ -6,7 +9,7 @@ impl Foo {
pub fn foo(&mut self) {}
}

// @has issue_74083/struct.Bar.html
// @has foo/struct.Bar.html
// @!has - '//div[@class="sidebar-links"]/a[@href="#method.foo"]' 'foo'
pub struct Bar {
foo: Foo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//@ aux-build:real_gimli.rs

// Ensure unstably exported traits have their Implementors sections.
// https://github.com/rust-lang/rust/issues/75588

#![crate_name = "foo"]
#![feature(extremely_unstable_foo)]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ aux-build:issue-57180.rs
// https://github.com/rust-lang/rust/issues/57180

extern crate issue_57180;
use issue_57180::Trait;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://github.com/rust-lang/rust/issues/72340

#![crate_name = "foo"]

pub struct Body;
Expand Down
8 changes: 0 additions & 8 deletions tests/rustdoc/issue-67851-hidden.rs

This file was deleted.

6 changes: 0 additions & 6 deletions tests/rustdoc/issue-67851-neither.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/rustdoc/issue-67851-private.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This code caused a panic in `pulldown-cmark` 0.4.1.
// https://github.com/rust-lang/rust/issues/60482

pub const BASIC_UNICODE: bool = true;

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

// This test ensures that if a blanket impl has the same ID as another impl, it'll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// https://github.com/rust-lang/rust/issues/56822
#![crate_name="foo"]

struct Wrapper<T>(T);

trait MyTrait {
Expand All @@ -16,7 +19,7 @@ impl<'a, T> MyTrait for Inner<'a, T> {
type Output = &'a T;
}

// @has issue_56822/struct.Parser.html
// @has foo/struct.Parser.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
// "impl<'a> Send for Parser<'a>"
pub struct Parser<'a> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// https://github.com/rust-lang/rust/issues/60726
#![crate_name="foo"]

use std::marker::PhantomData;

pub struct True;
Expand Down Expand Up @@ -25,7 +28,7 @@ where
I:InterfaceType<Send=True>
{}

// @has issue_60726/struct.IntoIter.html
// @has foo/struct.IntoIter.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
// "impl<T> !Send for IntoIter<T>"
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
//@ aux-build:issue-61592.rs
// https://github.com/rust-lang/rust/issues/61592
#![crate_name="bar"]

extern crate foo;

// @has issue_61592/index.html
// @has bar/index.html
// @has - '//a[@href="#reexports"]' 'Re-exports'
// @has - '//code' 'pub use foo::FooTrait as _;'
// @!has - '//a[@href="trait._.html"]' ''
pub use foo::FooTrait as _;

// @has issue_61592/index.html
// @has bar/index.html
// @has - '//a[@href="#reexports"]' 'Re-exports'
// @has - '//code' 'pub use foo::FooStruct as _;'
// @!has - '//a[@href="struct._.html"]' ''
Expand Down

0 comments on commit e7c13c3

Please sign in to comment.