diff options
| author | bors <bors@rust-lang.org> | 2021-07-14 12:49:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-14 12:49:45 +0000 |
| commit | ee5ed4a88d6a869cdb152829ed697d6459650db3 (patch) | |
| tree | 5b1b52d013354284696ad275e73a78d6152c917c /src | |
| parent | a08f25a7ef2800af5525762e981c24d96c14febe (diff) | |
| parent | afaca5ba79adeef77fea8c037c7449cbd1e77faa (diff) | |
| download | rust-ee5ed4a88d6a869cdb152829ed697d6459650db3.tar.gz rust-ee5ed4a88d6a869cdb152829ed697d6459650db3.zip | |
Auto merge of #87118 - JohnTitor:rollup-8ltidsq, r=JohnTitor
Rollup of 6 pull requests Successful merges: - #87085 (Search result colors) - #87090 (Make BTreeSet::split_off name elements like other set methods do) - #87098 (Unignore some pretty printing tests) - #87099 (Upgrade `cc` crate to 1.0.69) - #87101 (Suggest a path separator if a stray colon is found in a match arm) - #87102 (Add GUI test for "go to first" feature) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/themes/ayu.css | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/themes/dark.css | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/themes/light.css | 2 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/search-result-color.goml | 41 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/search-result-go-to-first.goml | 20 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/src/test_docs/lib.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-20427.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-22992.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-23338-ensure-param-drop-order.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-27401-dropflag-reinit.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-87086-colon-path-sep.rs | 66 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-87086-colon-path-sep.stderr | 68 |
13 files changed, 201 insertions, 10 deletions
diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 6fb7a1c088f..64f022b4e8d 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -40,7 +40,7 @@ cmake = "0.1.38" filetime = "0.2" num_cpus = "1.0" getopts = "0.2.19" -cc = "1.0.68" +cc = "1.0.69" libc = "0.2" serde = { version = "1.0.8", features = ["derive"] } serde_json = "1.0.2" diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css index 171d06c0a36..9da3fe07ade 100644 --- a/src/librustdoc/html/static/css/themes/ayu.css +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -161,7 +161,7 @@ pre, .rustdoc.source .example-wrap { .search-results a { color: #0096cf; } -.search-results a span.desc { +.search-results a div.desc { color: #c5c5c5; } @@ -286,7 +286,7 @@ details.undocumented > summary::before { color: grey; } -tr.result span.primitive::after, tr.result span.keyword::after { +.result-name .primitive > i, .result-name .keyword > i { color: #788797; } diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css index d9ea28058ad..599fb942dbe 100644 --- a/src/librustdoc/html/static/css/themes/dark.css +++ b/src/librustdoc/html/static/css/themes/dark.css @@ -247,7 +247,7 @@ details.undocumented > summary::before { color: grey; } -tr.result span.primitive::after, tr.result span.keyword::after { +.result-name .primitive > i, .result-name .keyword > i { color: #ddd; } diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css index 6785b79ffda..0c2799727f3 100644 --- a/src/librustdoc/html/static/css/themes/light.css +++ b/src/librustdoc/html/static/css/themes/light.css @@ -237,7 +237,7 @@ details.undocumented > summary::before { color: grey; } -tr.result span.primitive::after, tr.result span.keyword::after { +.result-name .primitive > i, .result-name .keyword > i { color: black; } diff --git a/src/test/rustdoc-gui/search-result-color.goml b/src/test/rustdoc-gui/search-result-color.goml new file mode 100644 index 00000000000..bb8ecb98fa3 --- /dev/null +++ b/src/test/rustdoc-gui/search-result-color.goml @@ -0,0 +1,41 @@ +// The goal of this test is to ensure the color of the text is the one expected. +goto: file://|DOC_PATH|/test_docs/index.html?search=coo + +// This is needed so that the text color is computed. +show-text: true + +// Ayu theme +local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"} +reload: + +// Waiting for the search results to appear... +wait-for: "#titles" +assert-css: ("//*[@class='desc']//*[text()='Just a normal struct.']", {"color": "rgb(197, 197, 197)"}) +assert-css: ("//*[@class='result-name']/*[text()='test_docs::']", {"color": "rgb(0, 150, 207)"}) + +// Checking the color for "keyword". +assert-css: ("//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(120, 135, 151)"}) + +// Dark theme +local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"} +reload: + +// Waiting for the search results to appear... +wait-for: "#titles" +assert-css: ("//*[@class='desc']//*[text()='Just a normal struct.']", {"color": "rgb(221, 221, 221)"}) +assert-css: ("//*[@class='result-name']/*[text()='test_docs::']", {"color": "rgb(221, 221, 221)"}) + +// Checking the color for "keyword". +assert-css: ("//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(221, 221, 221)"}) + +// Light theme +local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} +reload: + +// Waiting for the search results to appear... +wait-for: "#titles" +assert-css: ("//*[@class='desc']//*[text()='Just a normal struct.']", {"color": "rgb(0, 0, 0)"}) +assert-css: ("//*[@class='result-name']/*[text()='test_docs::']", {"color": "rgb(0, 0, 0)"}) + +// Checking the color for "keyword". +assert-css: ("//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(0, 0, 0)"}) diff --git a/src/test/rustdoc-gui/search-result-go-to-first.goml b/src/test/rustdoc-gui/search-result-go-to-first.goml new file mode 100644 index 00000000000..5d709f65881 --- /dev/null +++ b/src/test/rustdoc-gui/search-result-go-to-first.goml @@ -0,0 +1,20 @@ +// This test ensures that the "go_to_first" feature is working as expected. + +// First, we check that the first page doesn't have the string we're looking for to ensure +// that the feature is changing page as expected. +goto: file://|DOC_PATH|/test_docs/index.html +assert-text-false: (".fqn .in-band", "Struct test_docs::Foo") + +// We now check that we land on the search result page if "go_to_first" isn't set. +goto: file://|DOC_PATH|/test_docs/index.html?search=struct%3AFoo +// Waiting for the search results to appear... +wait-for: "#titles" +assert-text-false: (".fqn .in-band", "Struct test_docs::Foo") +// Ensure that the search results are displayed, not the "normal" content. +assert-css: ("#main", {"display": "none"}) + +// Now we can check that the feature is working as expected! +goto: file://|DOC_PATH|/test_docs/index.html?search=struct%3AFoo&go_to_first=true +// Waiting for the page to load... +wait-for: 500 +assert-text: (".fqn .in-band", "Struct test_docs::Foo") diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs index 3e753cb4de8..1b9f652120e 100644 --- a/src/test/rustdoc-gui/src/test_docs/lib.rs +++ b/src/test/rustdoc-gui/src/test_docs/lib.rs @@ -101,6 +101,7 @@ pub enum AnEnum { } #[doc(keyword = "CookieMonster")] +/// Some keyword. pub mod keyword {} /// Just some type alias. diff --git a/src/test/ui/issues/issue-20427.rs b/src/test/ui/issues/issue-20427.rs index 41922c62293..cfd8b2191ac 100644 --- a/src/test/ui/issues/issue-20427.rs +++ b/src/test/ui/issues/issue-20427.rs @@ -7,7 +7,6 @@ #![allow(deprecated, deprecated_in_future)] // aux-build:i8.rs -// ignore-pretty issue #37201 extern crate i8; use std::string as i16; diff --git a/src/test/ui/issues/issue-22992.rs b/src/test/ui/issues/issue-22992.rs index e2ae1f96ee5..292a0ae298d 100644 --- a/src/test/ui/issues/issue-22992.rs +++ b/src/test/ui/issues/issue-22992.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37201 struct X { val: i32 } impl std::ops::Deref for X { diff --git a/src/test/ui/issues/issue-23338-ensure-param-drop-order.rs b/src/test/ui/issues/issue-23338-ensure-param-drop-order.rs index 823be8c832d..a99f260dde3 100644 --- a/src/test/ui/issues/issue-23338-ensure-param-drop-order.rs +++ b/src/test/ui/issues/issue-23338-ensure-param-drop-order.rs @@ -1,8 +1,6 @@ // run-pass #![allow(non_upper_case_globals)] -// ignore-pretty issue #37201 - // This test is ensuring that parameters are indeed dropped after // temporaries in a fn body. diff --git a/src/test/ui/issues/issue-27401-dropflag-reinit.rs b/src/test/ui/issues/issue-27401-dropflag-reinit.rs index e137575c2f8..ab54af29bd6 100644 --- a/src/test/ui/issues/issue-27401-dropflag-reinit.rs +++ b/src/test/ui/issues/issue-27401-dropflag-reinit.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37201 // Check that when a `let`-binding occurs in a loop, its associated // drop-flag is reinitialized (to indicate "needs-drop" at the end of diff --git a/src/test/ui/parser/issue-87086-colon-path-sep.rs b/src/test/ui/parser/issue-87086-colon-path-sep.rs new file mode 100644 index 00000000000..4ee0b2054ff --- /dev/null +++ b/src/test/ui/parser/issue-87086-colon-path-sep.rs @@ -0,0 +1,66 @@ +// Tests that a suggestion is issued if the user wrote a colon instead of +// a path separator in a match arm. + +enum Foo { + Bar, + Baz, +} + +fn f() -> Foo { Foo::Bar } + +fn g1() { + match f() { + Foo:Bar => {} + //~^ ERROR: expected one of + //~| HELP: maybe write a path separator here + _ => {} + } + match f() { + Foo::Bar:Baz => {} + //~^ ERROR: expected one of + //~| HELP: maybe write a path separator here + _ => {} + } + match f() { + Foo:Bar::Baz => {} + //~^ ERROR: expected one of + //~| HELP: maybe write a path separator here + _ => {} + } + match f() { + Foo: Bar::Baz if true => {} + //~^ ERROR: expected one of + //~| HELP: maybe write a path separator here + _ => {} + } + if let Bar:Baz = f() { + //~^ ERROR: expected one of + //~| HELP: maybe write a path separator here + } +} + +fn g1_neg() { + match f() { + ref Foo: Bar::Baz => {} + //~^ ERROR: expected one of + _ => {} + } +} + +fn g2_neg() { + match f() { + mut Foo: Bar::Baz => {} + //~^ ERROR: expected one of + _ => {} + } +} + +fn main() { + let myfoo = Foo::Bar; + match myfoo { + Foo::Bar => {} + Foo:Bar::Baz => {} + //~^ ERROR: expected one of + //~| HELP: maybe write a path separator here + } +} diff --git a/src/test/ui/parser/issue-87086-colon-path-sep.stderr b/src/test/ui/parser/issue-87086-colon-path-sep.stderr new file mode 100644 index 00000000000..8f93661a626 --- /dev/null +++ b/src/test/ui/parser/issue-87086-colon-path-sep.stderr @@ -0,0 +1,68 @@ +error: expected one of `@` or `|`, found `:` + --> $DIR/issue-87086-colon-path-sep.rs:13:12 + | +LL | Foo:Bar => {} + | ^ + | | + | expected one of `@` or `|` + | help: maybe write a path separator here: `::` + +error: expected one of `!`, `(`, `...`, `..=`, `..`, `::`, `{`, or `|`, found `:` + --> $DIR/issue-87086-colon-path-sep.rs:19:17 + | +LL | Foo::Bar:Baz => {} + | ^ + | | + | expected one of 8 possible tokens + | help: maybe write a path separator here: `::` + +error: expected one of `@` or `|`, found `:` + --> $DIR/issue-87086-colon-path-sep.rs:25:12 + | +LL | Foo:Bar::Baz => {} + | ^ + | | + | expected one of `@` or `|` + | help: maybe write a path separator here: `::` + +error: expected one of `@` or `|`, found `:` + --> $DIR/issue-87086-colon-path-sep.rs:31:12 + | +LL | Foo: Bar::Baz if true => {} + | ^ + | | + | expected one of `@` or `|` + | help: maybe write a path separator here: `::` + +error: expected one of `@` or `|`, found `:` + --> $DIR/issue-87086-colon-path-sep.rs:36:15 + | +LL | if let Bar:Baz = f() { + | ^ + | | + | expected one of `@` or `|` + | help: maybe write a path separator here: `::` + +error: expected one of `=>`, `@`, `if`, or `|`, found `:` + --> $DIR/issue-87086-colon-path-sep.rs:44:16 + | +LL | ref Foo: Bar::Baz => {} + | ^ expected one of `=>`, `@`, `if`, or `|` + +error: expected one of `=>`, `@`, `if`, or `|`, found `:` + --> $DIR/issue-87086-colon-path-sep.rs:52:16 + | +LL | mut Foo: Bar::Baz => {} + | ^ expected one of `=>`, `@`, `if`, or `|` + +error: expected one of `@` or `|`, found `:` + --> $DIR/issue-87086-colon-path-sep.rs:62:12 + | +LL | Foo:Bar::Baz => {} + | ^ + | | + | expected one of `@` or `|` + | help: maybe write a path separator here: `::` + +error: aborting due to 8 previous errors + |
