diff options
| author | bors <bors@rust-lang.org> | 2021-11-24 23:09:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-24 23:09:42 +0000 |
| commit | d2c24aabcddd1eb11af633ab6b7391ae0cd00ea2 (patch) | |
| tree | d195ee55e89dd213150f665feeb6943ee5397c90 /src/test | |
| parent | b426445c60b4faab6e96d2b866164d478680abf6 (diff) | |
| parent | ae9681ecfad21f218ac3524dc798aafa35088202 (diff) | |
| download | rust-d2c24aabcddd1eb11af633ab6b7391ae0cd00ea2.tar.gz rust-d2c24aabcddd1eb11af633ab6b7391ae0cd00ea2.zip | |
Auto merge of #91203 - GuillaumeGomez:rollup-kwtqvb1, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - #89542 (Partially stabilize `duration_consts_2`) - #90044 (Restrict aarch64 outline atomics to glibc for now.) - #90420 (Create rustdoc_internals feature gate) - #91075 (Reduce prominence of item-infos) - #91151 (Fix test in std::process on android) - #91179 (Fix more <a> color) - #91199 (rustdoc: Add test for mixing doc comments and attrs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
19 files changed, 106 insertions, 43 deletions
diff --git a/src/test/rustdoc-gui/anchors.goml b/src/test/rustdoc-gui/anchors.goml index 6953009604c..4ce0ed1a4b8 100644 --- a/src/test/rustdoc-gui/anchors.goml +++ b/src/test/rustdoc-gui/anchors.goml @@ -1,17 +1,29 @@ +// This test is to ensure that the anchors (`ยง`) have the expected color. goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html +// This is needed to ensure that the text color is computed. +show-text: true + // Set the theme to light. local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} // We reload the page so the local storage settings are being used. reload: -assert-css: ("#toggle-all-docs", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".srclink", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".srclink", {"color": "rgba(0, 0, 0, 0)"}) +assert-css: ("#toggle-all-docs", {"color": "rgb(0, 0, 0)"}) +assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgb(0, 0, 0)"}) +assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgb(173, 68, 142)"}) +assert-css: (".srclink", {"color": "rgb(0, 0, 0)"}) +assert-css: (".srclink", {"color": "rgb(0, 0, 0)"}) + +assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"}) + +assert-css: (".sidebar a", {"color": "rgb(0, 0, 0)"}) +assert-css: (".in-band a", {"color": "rgb(0, 0, 0)"}) -assert-css: ("#top-doc-prose-title", {"color": "rgba(0, 0, 0, 0)"}) +// We move the cursor over the "Implementations" title so the anchor is displayed. +move-cursor-to: "h2#implementations" +assert-css: ("h2#implementations a.anchor", {"color": "rgb(0, 0, 0)"}) -assert-css: (".sidebar a", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".in-band a", {"color": "rgba(0, 0, 0, 0)"}) +// Same thing with the impl block title. +move-cursor-to: "#impl" +assert-css: ("#impl a.anchor", {"color": "rgb(0, 0, 0)"}) diff --git a/src/test/rustdoc-gui/headers-color.goml b/src/test/rustdoc-gui/headers-color.goml index b5be31bd2cc..7002812bb62 100644 --- a/src/test/rustdoc-gui/headers-color.goml +++ b/src/test/rustdoc-gui/headers-color.goml @@ -17,6 +17,9 @@ assert-css: ("#impl", {"color": "rgb(197, 197, 197)", "background-color": "rgba( goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use assert-css: ("#method\.must_use", {"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"}, ALL) +goto: file://|DOC_PATH|/test_docs/index.html +assert-css: (".section-header a", {"color": "rgb(197, 197, 197)"}, ALL) + // Dark theme local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"} goto: file://|DOC_PATH|/test_docs/struct.Foo.html @@ -30,6 +33,9 @@ assert-css: ("#impl", {"color": "rgb(221, 221, 221)", "background-color": "rgb(7 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use assert-css: ("#method\.must_use", {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"}, ALL) +goto: file://|DOC_PATH|/test_docs/index.html +assert-css: (".section-header a", {"color": "rgb(221, 221, 221)"}, ALL) + // Light theme local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} reload: @@ -44,3 +50,6 @@ assert-css: ("#impl", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 25 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use assert-css: ("#method\.must_use", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"}, ALL) + +goto: file://|DOC_PATH|/test_docs/index.html +assert-css: (".section-header a", {"color": "rgb(0, 0, 0)"}, ALL) diff --git a/src/test/rustdoc-gui/item-info-width.goml b/src/test/rustdoc-gui/item-info-width.goml index 44b79e60912..cdc00d34114 100644 --- a/src/test/rustdoc-gui/item-info-width.goml +++ b/src/test/rustdoc-gui/item-info-width.goml @@ -4,4 +4,4 @@ goto: file://|DOC_PATH|/lib2/struct.Foo.html size: (1100, 800) // We check that ".item-info" is bigger than its content. assert-css: (".item-info", {"width": "807px"}) -assert-css: (".item-info .stab", {"width": "343px"}) +assert-css: (".item-info .stab", {"width": "341px"}) diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs index 14d8b186130..458bcc4780c 100644 --- a/src/test/rustdoc-gui/src/test_docs/lib.rs +++ b/src/test/rustdoc-gui/src/test_docs/lib.rs @@ -2,7 +2,7 @@ //! documentation generated so we can test each different features. #![crate_name = "test_docs"] -#![feature(doc_keyword)] +#![feature(rustdoc_internals)] #![feature(doc_cfg)] use std::convert::AsRef; diff --git a/src/test/rustdoc-json/primitive.rs b/src/test/rustdoc-json/primitive.rs index 3a7d6d18c1b..b84c2f7c6ac 100644 --- a/src/test/rustdoc-json/primitive.rs +++ b/src/test/rustdoc-json/primitive.rs @@ -1,6 +1,6 @@ // edition:2018 -#![feature(doc_primitive)] +#![feature(rustdoc_internals)] #[doc(primitive = "usize")] mod usize {} diff --git a/src/test/rustdoc-ui/coverage/exotic.rs b/src/test/rustdoc-ui/coverage/exotic.rs index 18f2014d9e4..72b70d6980b 100644 --- a/src/test/rustdoc-ui/coverage/exotic.rs +++ b/src/test/rustdoc-ui/coverage/exotic.rs @@ -1,8 +1,7 @@ // compile-flags:-Z unstable-options --show-coverage // check-pass -#![feature(doc_keyword)] -#![feature(doc_primitive)] +#![feature(rustdoc_internals)] //! the features only used in std also have entries in the table, so make sure those get pulled out //! properly as well diff --git a/src/test/rustdoc-ui/invalid-keyword.rs b/src/test/rustdoc-ui/invalid-keyword.rs index ce2abc69bbd..2d70471c85e 100644 --- a/src/test/rustdoc-ui/invalid-keyword.rs +++ b/src/test/rustdoc-ui/invalid-keyword.rs @@ -1,4 +1,4 @@ -#![feature(doc_keyword)] +#![feature(rustdoc_internals)] #[doc(keyword = "foo df")] //~ ERROR mod foo {} diff --git a/src/test/rustdoc/issue-32374.rs b/src/test/rustdoc/issue-32374.rs index 4e92ae49a20..7654a561527 100644 --- a/src/test/rustdoc/issue-32374.rs +++ b/src/test/rustdoc/issue-32374.rs @@ -1,7 +1,6 @@ #![feature(staged_api)] #![doc(issue_tracker_base_url = "https://issue_url/")] - -#![unstable(feature="test", issue = "32374")] +#![unstable(feature = "test", issue = "32374")] // @matches issue_32374/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab deprecated"]' \ // 'Deprecated' @@ -23,12 +22,6 @@ pub struct T; // '๐ Deprecated since 1.0.0: deprecated' // @has issue_32374/struct.U.html '//*[@class="stab unstable"]' \ // '๐ฌ This is a nightly-only experimental API. (test #32374)' -// @has issue_32374/struct.U.html '//details' \ -// '๐ฌ This is a nightly-only experimental API. (test #32374)' -// @has issue_32374/struct.U.html '//summary' \ -// '๐ฌ This is a nightly-only experimental API. (test #32374)' -// @has issue_32374/struct.U.html '//details/p' \ -// 'unstable' #[rustc_deprecated(since = "1.0.0", reason = "deprecated")] #[unstable(feature = "test", issue = "32374", reason = "unstable")] pub struct U; diff --git a/src/test/rustdoc/keyword.rs b/src/test/rustdoc/keyword.rs index 652517c5c90..16f7cac5f51 100644 --- a/src/test/rustdoc/keyword.rs +++ b/src/test/rustdoc/keyword.rs @@ -1,6 +1,6 @@ #![crate_name = "foo"] -#![feature(doc_keyword)] +#![feature(rustdoc_internals)] // @has foo/index.html '//h2[@id="keywords"]' 'Keywords' // @has foo/index.html '//a[@href="keyword.match.html"]' 'match' diff --git a/src/test/rustdoc/mixing-doc-comments-and-attrs.rs b/src/test/rustdoc/mixing-doc-comments-and-attrs.rs new file mode 100644 index 00000000000..c26d3a31987 --- /dev/null +++ b/src/test/rustdoc/mixing-doc-comments-and-attrs.rs @@ -0,0 +1,26 @@ +#![crate_name = "foo"] + +// @has 'foo/struct.S1.html' +// @count - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p' \ +// 1 +// @has - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p[1]' \ +// 'Hello world! Goodbye! Hello again!' + +#[doc = "Hello world!\n\n"] +/// Goodbye! +#[doc = " Hello again!\n"] +pub struct S1; + +// @has 'foo/struct.S2.html' +// @count - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p' \ +// 2 +// @has - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p[1]' \ +// 'Hello world!' +// @has - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p[2]' \ +// 'Goodbye! Hello again!' + +/// Hello world! +/// +#[doc = "Goodbye!"] +/// Hello again! +pub struct S2; diff --git a/src/test/rustdoc/tab_title.rs b/src/test/rustdoc/tab_title.rs index 7dce6092dea..0cc4f147e1c 100644 --- a/src/test/rustdoc/tab_title.rs +++ b/src/test/rustdoc/tab_title.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -#![feature(doc_keyword)] +#![feature(rustdoc_internals)] // tests for the html <title> element diff --git a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs index 053712a4b4e..7783dc40fcf 100644 --- a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs +++ b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs @@ -1,7 +1,7 @@ // compile-flags: -Z unstable-options #![feature(rustc_private)] -#![feature(doc_keyword)] +#![feature(rustdoc_internals)] #![crate_type = "lib"] diff --git a/src/test/ui/feature-gates/feature-gate-doc_keyword.rs b/src/test/ui/feature-gates/feature-gate-doc_keyword.rs deleted file mode 100644 index 4bb9a40deb0..00000000000 --- a/src/test/ui/feature-gates/feature-gate-doc_keyword.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[doc(keyword = "match")] //~ ERROR: `#[doc(keyword)]` is experimental -/// wonderful -mod foo{} - -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-doc_keyword.stderr b/src/test/ui/feature-gates/feature-gate-doc_keyword.stderr deleted file mode 100644 index c5dc7d537fd..00000000000 --- a/src/test/ui/feature-gates/feature-gate-doc_keyword.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: `#[doc(keyword)]` is experimental - --> $DIR/feature-gate-doc_keyword.rs:1:1 - | -LL | #[doc(keyword = "match")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #51315 <https://github.com/rust-lang/rust/issues/51315> for more information - = help: add `#![feature(doc_keyword)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-rustdoc_internals.rs b/src/test/ui/feature-gates/feature-gate-rustdoc_internals.rs new file mode 100644 index 00000000000..d2ff4f62009 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-rustdoc_internals.rs @@ -0,0 +1,5 @@ +#[doc(keyword = "match")] //~ ERROR: `#[doc(keyword)]` is meant for internal use only +/// wonderful +mod foo {} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-rustdoc_internals.stderr b/src/test/ui/feature-gates/feature-gate-rustdoc_internals.stderr new file mode 100644 index 00000000000..e96461ac38a --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-rustdoc_internals.stderr @@ -0,0 +1,12 @@ +error[E0658]: `#[doc(keyword)]` is meant for internal use only + --> $DIR/feature-gate-rustdoc_internals.rs:1:1 + | +LL | #[doc(keyword = "match")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #90418 <https://github.com/rust-lang/rust/issues/90418> for more information + = help: add `#![feature(rustdoc_internals)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/rustdoc/doc_keyword.rs b/src/test/ui/rustdoc/doc_keyword.rs index 4518f77ef93..43b84e5018c 100644 --- a/src/test/ui/rustdoc/doc_keyword.rs +++ b/src/test/ui/rustdoc/doc_keyword.rs @@ -1,5 +1,5 @@ #![crate_type = "lib"] -#![feature(doc_keyword)] +#![feature(rustdoc_internals)] #![doc(keyword = "hello")] //~ ERROR diff --git a/src/test/ui/rustdoc/renamed-features-rustdoc_internals.rs b/src/test/ui/rustdoc/renamed-features-rustdoc_internals.rs new file mode 100644 index 00000000000..739c624d0c6 --- /dev/null +++ b/src/test/ui/rustdoc/renamed-features-rustdoc_internals.rs @@ -0,0 +1,5 @@ +#![feature(doc_keyword)] //~ ERROR +#![feature(doc_primitive)] //~ ERROR +#![crate_type = "lib"] + +pub fn foo() {} diff --git a/src/test/ui/rustdoc/renamed-features-rustdoc_internals.stderr b/src/test/ui/rustdoc/renamed-features-rustdoc_internals.stderr new file mode 100644 index 00000000000..d0979ce97ac --- /dev/null +++ b/src/test/ui/rustdoc/renamed-features-rustdoc_internals.stderr @@ -0,0 +1,19 @@ +error[E0557]: feature has been removed + --> $DIR/renamed-features-rustdoc_internals.rs:1:12 + | +LL | #![feature(doc_keyword)] + | ^^^^^^^^^^^ feature has been removed + | + = note: merged into `#![feature(rustdoc_internals)]` + +error[E0557]: feature has been removed + --> $DIR/renamed-features-rustdoc_internals.rs:2:12 + | +LL | #![feature(doc_primitive)] + | ^^^^^^^^^^^^^ feature has been removed + | + = note: merged into `#![feature(rustdoc_internals)]` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0557`. |
