Skip to content

Commit

Permalink
Rollup merge of #79412 - GuillaumeGomez:cleanup-rustdoc-tests, r=jyn514
Browse files Browse the repository at this point in the history
Clean up rustdoc tests by removing unnecessary features

r? ``@jyn514``
  • Loading branch information
jonas-schievink authored Nov 26, 2020
2 parents 005a3e5 + d61ea56 commit 7b72379
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 36 deletions.
2 changes: 0 additions & 2 deletions src/test/rustdoc-js/doc-alias-filter-out.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#![feature(doc_alias)]

#[doc(alias = "true")]
pub struct Foo;
2 changes: 0 additions & 2 deletions src/test/rustdoc-js/doc-alias-filter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(doc_alias)]

#[doc(alias = "true")]
pub struct Foo;

Expand Down
2 changes: 0 additions & 2 deletions src/test/rustdoc-js/doc-alias-whitespace.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#![feature(doc_alias)]

#[doc(alias = "Demon Lord")]
pub struct Struct;
2 changes: 0 additions & 2 deletions src/test/rustdoc-js/doc-alias.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(doc_alias)]

#[doc(alias = "StructItem")]
pub struct Struct {
#[doc(alias = "StructFieldItem")]
Expand Down
2 changes: 0 additions & 2 deletions src/test/rustdoc-ui/check-doc-alias-attr-location.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(doc_alias)]

pub struct Bar;
pub trait Foo {
type X;
Expand Down
8 changes: 4 additions & 4 deletions src/test/rustdoc-ui/check-doc-alias-attr-location.stderr
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
error: `#[doc(alias = "...")]` isn't allowed on extern block
--> $DIR/check-doc-alias-attr-location.rs:9:7
--> $DIR/check-doc-alias-attr-location.rs:7:7
|
LL | #[doc(alias = "foo")]
| ^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` isn't allowed on implementation block
--> $DIR/check-doc-alias-attr-location.rs:12:7
--> $DIR/check-doc-alias-attr-location.rs:10:7
|
LL | #[doc(alias = "bar")]
| ^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` isn't allowed on implementation block
--> $DIR/check-doc-alias-attr-location.rs:18:7
--> $DIR/check-doc-alias-attr-location.rs:16:7
|
LL | #[doc(alias = "foobar")]
| ^^^^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` isn't allowed on type alias in implementation block
--> $DIR/check-doc-alias-attr-location.rs:20:11
--> $DIR/check-doc-alias-attr-location.rs:18:11
|
LL | #[doc(alias = "assoc")]
| ^^^^^^^^^^^^^^^
Expand Down
1 change: 0 additions & 1 deletion src/test/rustdoc-ui/check-doc-alias-attr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![crate_type = "lib"]
#![feature(doc_alias)]

#[doc(alias = "foo")] // ok!
pub struct Bar;
Expand Down
18 changes: 9 additions & 9 deletions src/test/rustdoc-ui/check-doc-alias-attr.stderr
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
error: doc alias attribute expects a string: #[doc(alias = "0")]
--> $DIR/check-doc-alias-attr.rs:7:7
--> $DIR/check-doc-alias-attr.rs:6:7
|
LL | #[doc(alias)]
| ^^^^^

error: doc alias attribute expects a string: #[doc(alias = "0")]
--> $DIR/check-doc-alias-attr.rs:8:7
--> $DIR/check-doc-alias-attr.rs:7:7
|
LL | #[doc(alias = 0)]
| ^^^^^^^^^

error: doc alias attribute expects a string: #[doc(alias = "0")]
--> $DIR/check-doc-alias-attr.rs:9:7
--> $DIR/check-doc-alias-attr.rs:8:7
|
LL | #[doc(alias("bar"))]
| ^^^^^^^^^^^^

error: '\"' character isn't allowed in `#[doc(alias = "...")]`
--> $DIR/check-doc-alias-attr.rs:10:7
--> $DIR/check-doc-alias-attr.rs:9:7
|
LL | #[doc(alias = "\"")]
| ^^^^^^^^^^^^

error: '\n' character isn't allowed in `#[doc(alias = "...")]`
--> $DIR/check-doc-alias-attr.rs:11:7
--> $DIR/check-doc-alias-attr.rs:10:7
|
LL | #[doc(alias = "\n")]
| ^^^^^^^^^^^^

error: '\n' character isn't allowed in `#[doc(alias = "...")]`
--> $DIR/check-doc-alias-attr.rs:12:7
--> $DIR/check-doc-alias-attr.rs:11:7
|
LL | #[doc(alias = "
| _______^
LL | | ")]
| |_^

error: '\t' character isn't allowed in `#[doc(alias = "...")]`
--> $DIR/check-doc-alias-attr.rs:14:7
--> $DIR/check-doc-alias-attr.rs:13:7
|
LL | #[doc(alias = "\t")]
| ^^^^^^^^^^^^

error: `#[doc(alias = "...")]` cannot start or end with ' '
--> $DIR/check-doc-alias-attr.rs:15:7
--> $DIR/check-doc-alias-attr.rs:14:7
|
LL | #[doc(alias = " hello")]
| ^^^^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` cannot start or end with ' '
--> $DIR/check-doc-alias-attr.rs:16:7
--> $DIR/check-doc-alias-attr.rs:15:7
|
LL | #[doc(alias = "hello ")]
| ^^^^^^^^^^^^^^^^
Expand Down
1 change: 0 additions & 1 deletion src/test/rustdoc-ui/doc-alias-assoc-const.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(doc_alias)]
#![feature(trait_alias)]

pub struct Foo;
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/doc-alias-assoc-const.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: `#[doc(alias = "...")]` isn't allowed on associated constant in trait implementation block
--> $DIR/doc-alias-assoc-const.rs:11:11
--> $DIR/doc-alias-assoc-const.rs:10:11
|
LL | #[doc(alias = "CONST_BAZ")]
| ^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 0 additions & 3 deletions src/test/rustdoc-ui/doc-test-doctest-feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
// compile-flags:--test
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"

#![feature(cfg_doctest)]

// Make sure `cfg(doctest)` is set when finding doctests but not inside
// the doctests.

/// ```
/// #![feature(cfg_doctest)]
/// assert!(!cfg!(doctest));
/// ```
#[cfg(doctest)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/doc-test-doctest-feature.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/doc-test-doctest-feature.rs - Foo (line 10) ... ok
test $DIR/doc-test-doctest-feature.rs - Foo (line 8) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

2 changes: 0 additions & 2 deletions src/test/rustdoc/deprecated-future.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(deprecated)]

// @has deprecated_future/index.html '//*[@class="stab deprecated"]' \
// 'Deprecated'
// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \
Expand Down
2 changes: 0 additions & 2 deletions src/test/rustdoc/deprecated.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(deprecated)]

// @has deprecated/index.html '//*[@class="docblock-short"]/span[@class="stab deprecated"]' \
// 'Deprecated'
// @has - '//*[@class="docblock-short"]' 'Deprecated docs'
Expand Down
2 changes: 0 additions & 2 deletions src/test/rustdoc/issue-76501.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(const_fn)]

// @has 'issue_76501/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32'
/// A useless function that always returns 1.
pub const fn bloop() -> i32 {
Expand Down

0 comments on commit 7b72379

Please sign in to comment.