Skip to content

Rollup of 4 pull requests #106336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 1, 2023
3 changes: 3 additions & 0 deletions library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,9 @@ impl PathBuf {
/// and `path` is not empty, the new path is normalized: all references
/// to `.` and `..` are removed.
///
/// Consider using [`Path::join`] if you need a new `PathBuf` instead of
/// using this function on a cloned `PathBuf`.
///
/// # Examples
///
/// Pushing a relative path extends the existing path:
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ impl<'a> Builder<'a> {
crate::toolstate::ToolStateCheck,
test::ExpandYamlAnchors,
test::Tidy,
test::TidySelfTest,
test::Ui,
test::RunPassValgrind,
test::MirOpt,
Expand Down
34 changes: 34 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,40 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy`
}
}

/// Runs tidy's own tests.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct TidySelfTest;

impl Step for TidySelfTest {
type Output = ();
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.alias("tidyselftest")
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(TidySelfTest);
}

fn run(self, builder: &Builder<'_>) {
let bootstrap_host = builder.config.build;
let compiler = builder.compiler(0, bootstrap_host);
let cargo = tool::prepare_tool_cargo(
builder,
compiler,
Mode::ToolBootstrap,
bootstrap_host,
"test",
"src/tools/tidy",
SourceType::InTree,
&[],
);
try_run(builder, &mut cargo.into());
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct ExpandYamlAnchors;

Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/mingw-check-tidy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
ENV SCRIPT python3 ../x.py test --stage 0 src/tools/tidy
ENV SCRIPT python3 ../x.py test --stage 0 src/tools/tidy tidyselftest
16 changes: 6 additions & 10 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1861,9 +1861,13 @@ in storage.js
font-size: 12px;
position: relative;
bottom: 1px;
border-width: 1px;
border-style: solid;
border: 1px solid var(--scrape-example-help-border-color);
border-radius: 50px;
color: var(--scrape-example-help-color);
}
.scraped-example-list .scrape-help:hover {
border-color: var(--scrape-example-help-hover-border-color);
color: var(--scrape-example-help-hover-color);
}

.scraped-example {
Expand Down Expand Up @@ -1955,14 +1959,6 @@ in storage.js
.scraped-example .example-wrap .rust span.highlight.focus {
background: var(--scrape-example-code-line-highlight-focus);
}
.scraped-example-list .scrape-help {
border-color: var(--scrape-example-help-border-color);
color: var(--scrape-example-help-color);
}
.scraped-example-list .scrape-help:hover {
border-color: var(--scrape-example-help-hover-border-color);
color: var(--scrape-example-help-hover-color);
}

.more-examples-toggle {
max-width: calc(100% + 25px);
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/scrape-examples-fonts.goml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// This test ensures that the correct font is used in scraped examples.
goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"

store-value: (font, '"Fira Sans", Arial, NanumBarunGothic, sans-serif')
Expand Down
4 changes: 2 additions & 2 deletions src/tools/tidy/src/features/version/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ fn test_try_from_invalid_version() {

#[test]
fn test_try_from_single() {
assert_eq!("1.32.0".parse(), Ok(Version { parts: [1, 32, 0] }));
assert_eq!("1.0.0".parse(), Ok(Version { parts: [1, 0, 0] }));
assert_eq!("1.32.0".parse(), Ok(Version::Explicit { parts: [1, 32, 0] }));
assert_eq!("1.0.0".parse(), Ok(Version::Explicit { parts: [1, 0, 0] }));
}

#[test]
Expand Down