Skip to content

Commit c9825f7

Browse files
committed
Auto merge of rust-lang#106336 - matthiaskrgr:rollup-4p6bgwf, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - rust-lang#106280 (docs: add link to `Path::join` in `PathBuf::push`) - rust-lang#106297 (rustdoc: merge scrape-help CSS) - rust-lang#106328 (Add comment explaining what the GUI scrape-examples-fonts test is about) - rust-lang#106334 (Fix tidy unittest.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 574b64a + 0b3c3c9 commit c9825f7

File tree

7 files changed

+48
-13
lines changed

7 files changed

+48
-13
lines changed

library/std/src/path.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,9 @@ impl PathBuf {
12461246
/// and `path` is not empty, the new path is normalized: all references
12471247
/// to `.` and `..` are removed.
12481248
///
1249+
/// Consider using [`Path::join`] if you need a new `PathBuf` instead of
1250+
/// using this function on a cloned `PathBuf`.
1251+
///
12491252
/// # Examples
12501253
///
12511254
/// Pushing a relative path extends the existing path:

src/bootstrap/builder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ impl<'a> Builder<'a> {
662662
crate::toolstate::ToolStateCheck,
663663
test::ExpandYamlAnchors,
664664
test::Tidy,
665+
test::TidySelfTest,
665666
test::Ui,
666667
test::RunPassValgrind,
667668
test::MirOpt,

src/bootstrap/test.rs

+34
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,40 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy`
11431143
}
11441144
}
11451145

1146+
/// Runs tidy's own tests.
1147+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1148+
pub struct TidySelfTest;
1149+
1150+
impl Step for TidySelfTest {
1151+
type Output = ();
1152+
const DEFAULT: bool = true;
1153+
const ONLY_HOSTS: bool = true;
1154+
1155+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
1156+
run.alias("tidyselftest")
1157+
}
1158+
1159+
fn make_run(run: RunConfig<'_>) {
1160+
run.builder.ensure(TidySelfTest);
1161+
}
1162+
1163+
fn run(self, builder: &Builder<'_>) {
1164+
let bootstrap_host = builder.config.build;
1165+
let compiler = builder.compiler(0, bootstrap_host);
1166+
let cargo = tool::prepare_tool_cargo(
1167+
builder,
1168+
compiler,
1169+
Mode::ToolBootstrap,
1170+
bootstrap_host,
1171+
"test",
1172+
"src/tools/tidy",
1173+
SourceType::InTree,
1174+
&[],
1175+
);
1176+
try_run(builder, &mut cargo.into());
1177+
}
1178+
}
1179+
11461180
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
11471181
pub struct ExpandYamlAnchors;
11481182

src/ci/docker/host-x86_64/mingw-check-tidy/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
3333
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
3434

3535
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
36-
ENV SCRIPT python3 ../x.py test --stage 0 src/tools/tidy
36+
ENV SCRIPT python3 ../x.py test --stage 0 src/tools/tidy tidyselftest

src/librustdoc/html/static/css/rustdoc.css

+6-10
Original file line numberDiff line numberDiff line change
@@ -1861,9 +1861,13 @@ in storage.js
18611861
font-size: 12px;
18621862
position: relative;
18631863
bottom: 1px;
1864-
border-width: 1px;
1865-
border-style: solid;
1864+
border: 1px solid var(--scrape-example-help-border-color);
18661865
border-radius: 50px;
1866+
color: var(--scrape-example-help-color);
1867+
}
1868+
.scraped-example-list .scrape-help:hover {
1869+
border-color: var(--scrape-example-help-hover-border-color);
1870+
color: var(--scrape-example-help-hover-color);
18671871
}
18681872

18691873
.scraped-example {
@@ -1955,14 +1959,6 @@ in storage.js
19551959
.scraped-example .example-wrap .rust span.highlight.focus {
19561960
background: var(--scrape-example-code-line-highlight-focus);
19571961
}
1958-
.scraped-example-list .scrape-help {
1959-
border-color: var(--scrape-example-help-border-color);
1960-
color: var(--scrape-example-help-color);
1961-
}
1962-
.scraped-example-list .scrape-help:hover {
1963-
border-color: var(--scrape-example-help-hover-border-color);
1964-
color: var(--scrape-example-help-hover-color);
1965-
}
19661962

19671963
.more-examples-toggle {
19681964
max-width: calc(100% + 25px);

src/test/rustdoc-gui/scrape-examples-fonts.goml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// This test ensures that the correct font is used in scraped examples.
12
goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
23

34
store-value: (font, '"Fira Sans", Arial, NanumBarunGothic, sans-serif')

src/tools/tidy/src/features/version/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fn test_try_from_invalid_version() {
1212

1313
#[test]
1414
fn test_try_from_single() {
15-
assert_eq!("1.32.0".parse(), Ok(Version { parts: [1, 32, 0] }));
16-
assert_eq!("1.0.0".parse(), Ok(Version { parts: [1, 0, 0] }));
15+
assert_eq!("1.32.0".parse(), Ok(Version::Explicit { parts: [1, 32, 0] }));
16+
assert_eq!("1.0.0".parse(), Ok(Version::Explicit { parts: [1, 0, 0] }));
1717
}
1818

1919
#[test]

0 commit comments

Comments
 (0)