From d61ea568848ae11ba62193fba2a9d54e8b600c59 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 25 Nov 2020 14:27:51 +0100 Subject: [PATCH] Clean up rustdoc tests by removing unnecessary features --- src/test/rustdoc-js/doc-alias-filter-out.rs | 2 -- src/test/rustdoc-js/doc-alias-filter.rs | 2 -- src/test/rustdoc-js/doc-alias-whitespace.rs | 2 -- src/test/rustdoc-js/doc-alias.rs | 2 -- .../check-doc-alias-attr-location.rs | 2 -- .../check-doc-alias-attr-location.stderr | 8 ++++---- src/test/rustdoc-ui/check-doc-alias-attr.rs | 1 - .../rustdoc-ui/check-doc-alias-attr.stderr | 18 +++++++++--------- src/test/rustdoc-ui/doc-alias-assoc-const.rs | 1 - .../rustdoc-ui/doc-alias-assoc-const.stderr | 2 +- .../rustdoc-ui/doc-test-doctest-feature.rs | 3 --- .../rustdoc-ui/doc-test-doctest-feature.stdout | 2 +- src/test/rustdoc/deprecated-future.rs | 2 -- src/test/rustdoc/deprecated.rs | 2 -- src/test/rustdoc/issue-76501.rs | 2 -- 15 files changed, 15 insertions(+), 36 deletions(-) diff --git a/src/test/rustdoc-js/doc-alias-filter-out.rs b/src/test/rustdoc-js/doc-alias-filter-out.rs index 815e8cedd16da..3f0c094794e41 100644 --- a/src/test/rustdoc-js/doc-alias-filter-out.rs +++ b/src/test/rustdoc-js/doc-alias-filter-out.rs @@ -1,4 +1,2 @@ -#![feature(doc_alias)] - #[doc(alias = "true")] pub struct Foo; diff --git a/src/test/rustdoc-js/doc-alias-filter.rs b/src/test/rustdoc-js/doc-alias-filter.rs index 8887f8c2b0149..d5227814c06a8 100644 --- a/src/test/rustdoc-js/doc-alias-filter.rs +++ b/src/test/rustdoc-js/doc-alias-filter.rs @@ -1,5 +1,3 @@ -#![feature(doc_alias)] - #[doc(alias = "true")] pub struct Foo; diff --git a/src/test/rustdoc-js/doc-alias-whitespace.rs b/src/test/rustdoc-js/doc-alias-whitespace.rs index bea3e382ae4b0..16c022c749890 100644 --- a/src/test/rustdoc-js/doc-alias-whitespace.rs +++ b/src/test/rustdoc-js/doc-alias-whitespace.rs @@ -1,4 +1,2 @@ -#![feature(doc_alias)] - #[doc(alias = "Demon Lord")] pub struct Struct; diff --git a/src/test/rustdoc-js/doc-alias.rs b/src/test/rustdoc-js/doc-alias.rs index 41caa98643cdd..750b7b757bc35 100644 --- a/src/test/rustdoc-js/doc-alias.rs +++ b/src/test/rustdoc-js/doc-alias.rs @@ -1,5 +1,3 @@ -#![feature(doc_alias)] - #[doc(alias = "StructItem")] pub struct Struct { #[doc(alias = "StructFieldItem")] diff --git a/src/test/rustdoc-ui/check-doc-alias-attr-location.rs b/src/test/rustdoc-ui/check-doc-alias-attr-location.rs index 545964c7bd61b..7de2caa189dc7 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr-location.rs +++ b/src/test/rustdoc-ui/check-doc-alias-attr-location.rs @@ -1,5 +1,3 @@ -#![feature(doc_alias)] - pub struct Bar; pub trait Foo { type X; diff --git a/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr b/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr index a66e9939eaf18..175626f49dcac 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr +++ b/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr @@ -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")] | ^^^^^^^^^^^^^^^ diff --git a/src/test/rustdoc-ui/check-doc-alias-attr.rs b/src/test/rustdoc-ui/check-doc-alias-attr.rs index 0ca2349a43b0f..912e35f916545 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr.rs +++ b/src/test/rustdoc-ui/check-doc-alias-attr.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(doc_alias)] #[doc(alias = "foo")] // ok! pub struct Bar; diff --git a/src/test/rustdoc-ui/check-doc-alias-attr.stderr b/src/test/rustdoc-ui/check-doc-alias-attr.stderr index 2c417a3bb65b5..8a729b02e72bf 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr.stderr +++ b/src/test/rustdoc-ui/check-doc-alias-attr.stderr @@ -1,35 +1,35 @@ 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 = " | _______^ @@ -37,19 +37,19 @@ 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 ")] | ^^^^^^^^^^^^^^^^ diff --git a/src/test/rustdoc-ui/doc-alias-assoc-const.rs b/src/test/rustdoc-ui/doc-alias-assoc-const.rs index 73e23c152f268..d95324734be47 100644 --- a/src/test/rustdoc-ui/doc-alias-assoc-const.rs +++ b/src/test/rustdoc-ui/doc-alias-assoc-const.rs @@ -1,4 +1,3 @@ -#![feature(doc_alias)] #![feature(trait_alias)] pub struct Foo; diff --git a/src/test/rustdoc-ui/doc-alias-assoc-const.stderr b/src/test/rustdoc-ui/doc-alias-assoc-const.stderr index 3c64548cc204d..cbca40e1364fa 100644 --- a/src/test/rustdoc-ui/doc-alias-assoc-const.stderr +++ b/src/test/rustdoc-ui/doc-alias-assoc-const.stderr @@ -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")] | ^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/rustdoc-ui/doc-test-doctest-feature.rs b/src/test/rustdoc-ui/doc-test-doctest-feature.rs index 9a79fb8838351..2798804880ad0 100644 --- a/src/test/rustdoc-ui/doc-test-doctest-feature.rs +++ b/src/test/rustdoc-ui/doc-test-doctest-feature.rs @@ -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)] diff --git a/src/test/rustdoc-ui/doc-test-doctest-feature.stdout b/src/test/rustdoc-ui/doc-test-doctest-feature.stdout index 75d29fab17d0d..b1cd74bf8520a 100644 --- a/src/test/rustdoc-ui/doc-test-doctest-feature.stdout +++ b/src/test/rustdoc-ui/doc-test-doctest-feature.stdout @@ -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 diff --git a/src/test/rustdoc/deprecated-future.rs b/src/test/rustdoc/deprecated-future.rs index c5248c52fb973..7db8cc6028179 100644 --- a/src/test/rustdoc/deprecated-future.rs +++ b/src/test/rustdoc/deprecated-future.rs @@ -1,5 +1,3 @@ -#![feature(deprecated)] - // @has deprecated_future/index.html '//*[@class="stab deprecated"]' \ // 'Deprecated' // @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \ diff --git a/src/test/rustdoc/deprecated.rs b/src/test/rustdoc/deprecated.rs index 18a33438a2346..a286856b2c3c1 100644 --- a/src/test/rustdoc/deprecated.rs +++ b/src/test/rustdoc/deprecated.rs @@ -1,5 +1,3 @@ -#![feature(deprecated)] - // @has deprecated/index.html '//*[@class="docblock-short"]/span[@class="stab deprecated"]' \ // 'Deprecated' // @has - '//*[@class="docblock-short"]' 'Deprecated docs' diff --git a/src/test/rustdoc/issue-76501.rs b/src/test/rustdoc/issue-76501.rs index 605059fe0dd8d..d468f35e28003 100644 --- a/src/test/rustdoc/issue-76501.rs +++ b/src/test/rustdoc/issue-76501.rs @@ -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 {