Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ignore = [
"/tests/pretty/", # These tests are very sensitive to source code layout.
"/tests/run-make/export", # These tests contain syntax errors.
"/tests/run-make/translation/test.rs", # This test contains syntax errors.
"/tests/rustdoc/", # Some have syntax errors, some are whitespace-sensitive.
"/tests/rustdoc-html/", # Some have syntax errors, some are whitespace-sensitive.
"/tests/rustdoc-gui/", # Some tests are sensitive to source code layout.
"/tests/rustdoc-ui/", # Some have syntax errors, some are whitespace-sensitive.
"/tests/ui/", # Some have syntax errors, some are whitespace-sensitive.
Expand Down
14 changes: 7 additions & 7 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1582,10 +1582,10 @@ test!(UiFullDeps {
IS_HOST: true,
});

test!(Rustdoc {
path: "tests/rustdoc",
mode: CompiletestMode::Rustdoc,
suite: "rustdoc",
test!(RustdocHtml {
path: "tests/rustdoc-html",
mode: CompiletestMode::RustdocHtml,
suite: "rustdoc-html",
default: true,
IS_HOST: true,
});
Expand Down Expand Up @@ -1969,7 +1969,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
if matches!(
mode,
CompiletestMode::RunMake
| CompiletestMode::Rustdoc
| CompiletestMode::RustdocHtml
| CompiletestMode::RustdocJs
| CompiletestMode::RustdocJson
) || matches!(suite, "rustdoc-ui" | "coverage-run-rustdoc")
Expand Down Expand Up @@ -2758,7 +2758,7 @@ impl Step for ErrorIndex {
fn make_run(run: RunConfig<'_>) {
// error_index_generator depends on librustdoc. Use the compiler that
// is normally used to build rustdoc for other tests (like compiletest
// tests in tests/rustdoc) so that it shares the same artifacts.
// tests in tests/rustdoc-html) so that it shares the same artifacts.
let compilers = RustcPrivateCompilers::new(
run.builder,
run.builder.top_stage,
Expand Down Expand Up @@ -3159,7 +3159,7 @@ impl Step for CrateRustdoc {
builder.compiler(builder.top_stage, target)
} else {
// Use the previous stage compiler to reuse the artifacts that are
// created when running compiletest for tests/rustdoc. If this used
// created when running compiletest for tests/rustdoc-html. If this used
// `compiler`, then it would cause rustdoc to be built *again*, which
// isn't really necessary.
builder.compiler_for(builder.top_stage, target, target)
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/src/core/build_steps/test/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(crate) enum CompiletestMode {
MirOpt,
Pretty,
RunMake,
Rustdoc,
RustdocHtml,
RustdocJs,
RustdocJson,
Ui,
Expand Down Expand Up @@ -49,7 +49,7 @@ impl CompiletestMode {
Self::MirOpt => "mir-opt",
Self::Pretty => "pretty",
Self::RunMake => "run-make",
Self::Rustdoc => "rustdoc",
Self::RustdocHtml => "rustdoc-html",
Self::RustdocJs => "rustdoc-js",
Self::RustdocJson => "rustdoc-json",
Self::Ui => "ui",
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/builder/cli_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub(crate) const PATH_REMAP: &[(&str, &[&str])] = &[
"tests/pretty",
"tests/run-make",
"tests/run-make-cargo",
"tests/rustdoc",
"tests/rustdoc-gui",
"tests/rustdoc-html",
"tests/rustdoc-js",
"tests/rustdoc-js-std",
"tests/rustdoc-json",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test
---
[Test] test::Tidy
Expand Down Expand Up @@ -38,9 +37,9 @@ expression: test
[Test] test::UiFullDeps
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/ui-fulldeps)
[Test] test::Rustdoc
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
- Suite(test::tests/rustdoc-html)
[Test] test::CoverageRunRustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/coverage-run-rustdoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ expression: test librustdoc rustdoc
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/librustdoc, test::src/tools/rustdoc})
[Test] test::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
[Test] test::RustdocBook
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/doc/rustdoc})
Copy link
Member

@fmease fmease Jan 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you can see from the test expectation changes, running ./x test librustdoc rustdoc no longer tests tests/rustdoc (since it no longer exists).

You should update the expression from rustdoc to rustdoc-html, rename this file and rebless the snap. Similarly for the other test file.

Copy link
Member

@fmease fmease Jan 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(If we ever introduce rustdoc as an alias for all rustdoc-* test suites, we can change the rustdoc-html back to rustdoc in these two tests (or just keep them and add new ones))

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
expression: test librustdoc rustdoc-html
---
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/librustdoc})
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-html)
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
expression: test rustdoc
---
[Test] test::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/rustdoc})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
expression: test rustdoc-html
---
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-html)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test --skip=coverage
---
[Test] test::Tidy
Expand Down Expand Up @@ -37,9 +36,9 @@ expression: test --skip=coverage
[Test] test::UiFullDeps
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/ui-fulldeps)
[Test] test::Rustdoc
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
- Suite(test::tests/rustdoc-html)
[Test] test::CoverageRunRustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/coverage-run-rustdoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ expression: test tests
[Test] test::RunMakeCargo
targets: [aarch64-unknown-linux-gnu]
- Suite(test::tests/run-make-cargo)
[Test] test::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
[Test] test::RustdocGUI
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-gui)
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-html)
[Test] test::RustdocJSNotStd
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-js)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ expression: test tests --skip=coverage
[Test] test::RunMakeCargo
targets: [aarch64-unknown-linux-gnu]
- Suite(test::tests/run-make-cargo)
[Test] test::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
[Test] test::RustdocGUI
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-gui)
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-html)
[Test] test::RustdocJSNotStd
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-js)
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/src/core/builder/cli_paths/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ declare_tests!(
(x_test_library, "test library"),
(x_test_librustdoc, "test librustdoc"),
(x_test_librustdoc_rustdoc, "test librustdoc rustdoc"),
(x_test_librustdoc_rustdoc_html, "test librustdoc rustdoc-html"),
(x_test_rustdoc, "test rustdoc"),
(x_test_rustdoc_html, "test rustdoc-html"),
(x_test_skip_coverage, "test --skip=coverage"),
// FIXME(Zalathar): This doesn't skip the coverage-map or coverage-run tests.
(x_test_skip_tests, "test --skip=tests"),
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ impl<'a> Builder<'a> {
test::Incremental,
test::Debuginfo,
test::UiFullDeps,
test::Rustdoc,
test::RustdocHtml,
test::CoverageRunRustdoc,
test::Pretty,
test::CodegenCranelift,
Expand Down
19 changes: 8 additions & 11 deletions src/bootstrap/src/core/builder/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ mod snapshot {
[test] compiletest-debuginfo 1 <host>
[test] compiletest-ui-fulldeps 1 <host>
[build] rustdoc 1 <host>
[test] compiletest-rustdoc 1 <host>
[test] compiletest-rustdoc-html 1 <host>
[test] compiletest-coverage-run-rustdoc 1 <host>
[test] compiletest-pretty 1 <host>
[build] rustc 1 <host> -> std 1 <host>
Expand Down Expand Up @@ -2169,7 +2169,7 @@ mod snapshot {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("test")
.args(&["ui", "ui-fulldeps", "run-make", "rustdoc", "rustdoc-gui", "incremental"])
.args(&["ui", "ui-fulldeps", "run-make", "rustdoc-html", "rustdoc-gui", "incremental"])
.render_steps(), @r"
[build] llvm <host>
[build] rustc 0 <host> -> rustc 1 <host>
Expand All @@ -2180,11 +2180,10 @@ mod snapshot {
[build] rustc 0 <host> -> RunMakeSupport 1 <host>
[build] rustdoc 1 <host>
[test] compiletest-run-make 1 <host>
[test] compiletest-rustdoc 1 <host>
[test] compiletest-rustdoc-html 1 <host>
[build] rustc 0 <host> -> RustdocGUITest 1 <host>
[test] rustdoc-gui 1 <host>
[test] compiletest-incremental 1 <host>
[build] rustc 1 <host> -> rustc 2 <host>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm slightly worried about this disappearing... I don't see why that has happened (similarly for the other tests in this file). I haven't looked closely at these tests & I'm not super familar with bootstrap's innards, so I might be missing sth.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait for @Kobzol to have a look to ensure I didn't break something.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this is because x test rustdoc also tries to run unit tests for src/tools/rustdoc, despite that being a stub crate with no tests in it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, looking at the results of running x test src/tools/rustdoc on main, I have no idea what's going on. 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, x test src/tools/rustdoc is effectively treated as an alias for x test src/librustdoc, so it's running the unit tests and doctests for src/librustdoc.

");
}

Expand All @@ -2193,7 +2192,7 @@ mod snapshot {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("test")
.args(&["ui", "ui-fulldeps", "run-make", "rustdoc", "rustdoc-gui", "incremental"])
.args(&["ui", "ui-fulldeps", "run-make", "rustdoc-html", "rustdoc-gui", "incremental"])
.stage(2)
.render_steps(), @r"
[build] llvm <host>
Expand All @@ -2208,11 +2207,10 @@ mod snapshot {
[build] rustc 0 <host> -> RunMakeSupport 1 <host>
[build] rustdoc 2 <host>
[test] compiletest-run-make 2 <host>
[test] compiletest-rustdoc 2 <host>
[test] compiletest-rustdoc-html 2 <host>
[build] rustc 0 <host> -> RustdocGUITest 1 <host>
[test] rustdoc-gui 2 <host>
[test] compiletest-incremental 2 <host>
[build] rustdoc 1 <host>
");
}

Expand Down Expand Up @@ -2241,12 +2239,11 @@ mod snapshot {
[build] rustc 0 <host> -> RunMakeSupport 1 <host>
[build] rustdoc 2 <host>
[test] compiletest-run-make 2 <target1>
[test] compiletest-rustdoc 2 <target1>
[build] rustc 1 <host> -> rustc 2 <target1>
[build] rustdoc 1 <host>
[build] rustc 0 <host> -> RustdocGUITest 1 <host>
[test] rustdoc-gui 2 <target1>
[test] compiletest-incremental 2 <target1>
[build] rustc 1 <host> -> rustc 2 <target1>
[build] rustdoc 1 <host>
[build] rustc 2 <target1> -> std 2 <target1>
[build] rustdoc 2 <target1>
");
Expand Down Expand Up @@ -2283,7 +2280,7 @@ mod snapshot {
[build] rustc 2 <host> -> rustc 3 <host>
[test] compiletest-ui-fulldeps 2 <host>
[build] rustdoc 2 <host>
[test] compiletest-rustdoc 2 <host>
[test] compiletest-rustdoc-html 2 <host>
[test] compiletest-coverage-run-rustdoc 2 <host>
[test] compiletest-pretty 2 <host>
[build] rustc 2 <host> -> std 2 <host>
Expand Down
2 changes: 1 addition & 1 deletion src/ci/citool/tests/test-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runners:
<<: *base-job
envs:
env-x86_64-apple-tests: &env-x86_64-apple-tests
SCRIPT: ./x.py check compiletest && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact
SCRIPT: ./x.py check compiletest && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc-html -- --exact
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
# Ensure that host tooling is tested on our minimum supported macOS version.
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/x86_64-gnu-gcc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ENV SCRIPT python3 ../x.py \
--test-codegen-backend gcc \
--skip tests/coverage \
--skip tests/coverage-run-rustdoc \
--skip tests/rustdoc \
--skip tests/rustdoc-html \
--skip tests/rustdoc-gui \
--skip tests/rustdoc-js \
--skip tests/rustdoc-js-std \
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
- [Parallel compilation](./parallel-rustc.md)
- [Rustdoc internals](./rustdoc-internals.md)
- [Search](./rustdoc-internals/search.md)
- [The `rustdoc` test suite](./rustdoc-internals/rustdoc-test-suite.md)
- [The `rustdoc-html` test suite](./rustdoc-internals/rustdoc-html-test-suite.md)
- [The `rustdoc-gui` test suite](./rustdoc-internals/rustdoc-gui-test-suite.md)
- [The `rustdoc-json` test suite](./rustdoc-internals/rustdoc-json-test-suite.md)
- [GPU offload internals](./offload/internals.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The `rustdoc` test suite
# The `rustdoc-html` test suite

This page is about the test suite named `rustdoc` used to test the HTML output of `rustdoc`.
This page is about the test suite named `rustdoc-html` used to test the HTML output of `rustdoc`.
For other rustdoc-specific test suites, see [Rustdoc test suites].

Each test file in this test suite is simply a Rust source file `file.rs` sprinkled with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Also, talk about how it works
## jsondocck

[jsondocck] processes directives given in comments, to assert that the values in the output are expected.
It's a lot like [htmldocck](./rustdoc-test-suite.md) in that way.
It's a lot like [htmldocck](./rustdoc-html-test-suite.md) in that way.

It uses [JSONPath] as a query language, which takes a path, and returns a *list* of values that that path is said to match to.

Expand Down
4 changes: 2 additions & 2 deletions src/doc/rustc-dev-guide/src/tests/compiletest.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The following test suites are available, with links for more information:

| Test suite | Purpose |
|--------------------------------------|--------------------------------------------------------------------------|
| [`rustdoc`][rustdoc-html-tests] | Check HTML output of `rustdoc` |
| [`rustdoc-html`][rustdoc-html-tests] | Check HTML output of `rustdoc` |
| [`rustdoc-gui`][rustdoc-gui-tests] | Check `rustdoc`'s GUI using a web browser |
| [`rustdoc-js`][rustdoc-js-tests] | Check `rustdoc`'s search engine and index |
| [`rustdoc-js-std`][rustdoc-js-tests] | Check `rustdoc`'s search engine and index on the std library docs |
Expand All @@ -94,7 +94,7 @@ These tests ensure that certain lints that are emitted as part of executing rust
are also run when executing rustc.
Run-make tests pertaining to rustdoc are typically named `run-make/rustdoc-*/`.

[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-test-suite.md
[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-html-test-suite.md
[rustdoc-gui-tests]: ../rustdoc-internals/rustdoc-gui-test-suite.md
[rustdoc-js-tests]: ../rustdoc-internals/search.md#testing-the-search-engine
[rustdoc-json-tests]: ../rustdoc-internals/rustdoc-json-test-suite.md
Expand Down
4 changes: 2 additions & 2 deletions src/doc/rustc-dev-guide/src/tests/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ Asked in

#### Test-suite-specific directives

The test suites [`rustdoc`][rustdoc-html-tests], [`rustdoc-js`/`rustdoc-js-std`][rustdoc-js-tests]
The test suites [`rustdoc-html`][rustdoc-html-tests], [`rustdoc-js`/`rustdoc-js-std`][rustdoc-js-tests]
and [`rustdoc-json`][rustdoc-json-tests] each feature an additional set of directives whose basic
syntax resembles the one of compiletest directives but which are ultimately read and checked by
separate tools. For more information, please read their respective chapters as linked above.

[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-test-suite.md
[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-html-test-suite.md
[rustdoc-js-tests]: ../rustdoc-internals/search.html#testing-the-search-engine
[rustdoc-json-tests]: ../rustdoc-internals/rustdoc-json-test-suite.md

Expand Down
3 changes: 2 additions & 1 deletion src/librustdoc/html/render/write_shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,8 @@ impl<'item> DocVisitor<'item> for TypeImplCollector<'_, '_, 'item> {
//
// FIXME(lazy_type_alias): Once the feature is complete or stable, rewrite this
// to use type unification.
// Be aware of `tests/rustdoc/type-alias/deeply-nested-112515.rs` which might regress.
// Be aware of `tests/rustdoc-html/type-alias/deeply-nested-112515.rs` which might
// regress.
let Some(impl_did) = impl_item_id.as_def_id() else { continue };
let for_ty = self.cx.tcx().type_of(impl_did).skip_binder();
let reject_cx = DeepRejectCtxt::relate_infer_infer(self.cx.tcx());
Expand Down
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ string_enum! {
Pretty => "pretty",
DebugInfo => "debuginfo",
Codegen => "codegen",
Rustdoc => "rustdoc",
RustdocHtml => "rustdoc-html",
RustdocJson => "rustdoc-json",
CodegenUnits => "codegen-units",
Incremental => "incremental",
Expand Down Expand Up @@ -69,7 +69,7 @@ string_enum! {
Pretty => "pretty",
RunMake => "run-make",
RunMakeCargo => "run-make-cargo",
Rustdoc => "rustdoc",
RustdocHtml => "rustdoc-html",
RustdocGui => "rustdoc-gui",
RustdocJs => "rustdoc-js",
RustdocJsStd=> "rustdoc-js-std",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/directives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ fn check_directive<'a>(

let is_known_directive = KNOWN_DIRECTIVE_NAMES_SET.contains(&directive_name)
|| match mode {
TestMode::Rustdoc => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES.contains(&directive_name),
TestMode::RustdocHtml => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES.contains(&directive_name),
TestMode::RustdocJson => KNOWN_JSONDOCCK_DIRECTIVE_NAMES.contains(&directive_name),
_ => false,
};
Expand Down
Loading
Loading