Skip to content

Commit 18841ec

Browse files
committed
Revert fmt version, add rustdoc-json-types to bootstrap tests
1 parent 70c9b37 commit 18841ec

File tree

4 files changed

+73
-3
lines changed

4 files changed

+73
-3
lines changed

Cargo.lock

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# This file is automatically @generated by Cargo.
22
# It is not intended for manual editing.
3-
version = 3
4-
53
[[package]]
64
name = "addr2line"
75
version = "0.14.0"

src/bootstrap/builder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ impl<'a> Builder<'a> {
397397
test::Crate,
398398
test::CrateLibrustc,
399399
test::CrateRustdoc,
400+
test::CrateRustdocJsonTypes,
400401
test::Linkcheck,
401402
test::TierCheck,
402403
test::Cargotest,

src/bootstrap/test.rs

+71
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,77 @@ impl Step for CrateRustdoc {
19221922
}
19231923
}
19241924

1925+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1926+
pub struct CrateRustdocJsonTypes {
1927+
host: TargetSelection,
1928+
test_kind: TestKind,
1929+
}
1930+
1931+
impl Step for CrateRustdocJsonTypes {
1932+
type Output = ();
1933+
const DEFAULT: bool = true;
1934+
const ONLY_HOSTS: bool = true;
1935+
1936+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
1937+
run.path("src/rustdoc-json-types")
1938+
}
1939+
1940+
fn make_run(run: RunConfig<'_>) {
1941+
let builder = run.builder;
1942+
1943+
let test_kind = builder.kind.into();
1944+
1945+
builder.ensure(CrateRustdocJsonTypes { host: run.target, test_kind });
1946+
}
1947+
1948+
fn run(self, builder: &Builder<'_>) {
1949+
let test_kind = self.test_kind;
1950+
let target = self.host;
1951+
1952+
// Use the previous stage compiler to reuse the artifacts that are
1953+
// created when running compiletest for src/test/rustdoc. If this used
1954+
// `compiler`, then it would cause rustdoc to be built *again*, which
1955+
// isn't really necessary.
1956+
let compiler = builder.compiler_for(builder.top_stage, target, target);
1957+
builder.ensure(compile::Rustc { compiler, target });
1958+
1959+
let mut cargo = tool::prepare_tool_cargo(
1960+
builder,
1961+
compiler,
1962+
Mode::ToolRustc,
1963+
target,
1964+
test_kind.subcommand(),
1965+
"src/rustdoc-json-types",
1966+
SourceType::InTree,
1967+
&[],
1968+
);
1969+
if test_kind.subcommand() == "test" && !builder.fail_fast {
1970+
cargo.arg("--no-fail-fast");
1971+
}
1972+
1973+
cargo.arg("-p").arg("rustdoc-json-types");
1974+
1975+
cargo.arg("--");
1976+
cargo.args(&builder.config.cmd.test_args());
1977+
1978+
if self.host.contains("musl") {
1979+
cargo.arg("'-Ctarget-feature=-crt-static'");
1980+
}
1981+
1982+
if !builder.config.verbose_tests {
1983+
cargo.arg("--quiet");
1984+
}
1985+
1986+
builder.info(&format!(
1987+
"{} rustdoc-json-types stage{} ({} -> {})",
1988+
test_kind, compiler.stage, &compiler.host, target
1989+
));
1990+
let _time = util::timeit(&builder);
1991+
1992+
try_run(builder, &mut cargo.into());
1993+
}
1994+
}
1995+
19251996
/// Some test suites are run inside emulators or on remote devices, and most
19261997
/// of our test binaries are linked dynamically which means we need to ship
19271998
/// the standard library and such to the emulator ahead of time. This step

src/librustdoc/json/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
242242
)
243243
})
244244
.collect(),
245-
format_version: 5,
245+
format_version: 4,
246246
};
247247
let mut p = self.out_path.clone();
248248
p.push(output.index.get(&output.root).unwrap().name.clone().unwrap());

0 commit comments

Comments
 (0)