Skip to content

Commit 0a867e6

Browse files
Rollup merge of rust-lang#137119 - onur-ozkan:fix-broken-core, r=jieyouxu
fix broken `x {doc, build} core` Fixes rust-lang#137115
2 parents 0c3dcae + 56f8f48 commit 0a867e6

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl Step for Std {
9797
const DEFAULT: bool = true;
9898

9999
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
100-
run.crate_or_deps("sysroot").path("library").alias("core")
100+
run.crate_or_deps("sysroot").path("library")
101101
}
102102

103103
#[cfg_attr(feature = "tracing", instrument(level = "trace", name = "Std::make_run", skip_all))]

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,7 @@ impl Step for Std {
572572

573573
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
574574
let builder = run.builder;
575-
run.crate_or_deps("sysroot")
576-
.path("library")
577-
.alias("core")
578-
.default_condition(builder.config.docs)
575+
run.crate_or_deps("sysroot").path("library").default_condition(builder.config.docs)
579576
}
580577

581578
fn make_run(run: RunConfig<'_>) {

src/bootstrap/src/core/builder/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,14 @@ impl RunConfig<'_> {
129129
pub fn cargo_crates_in_set(&self) -> Vec<String> {
130130
let mut crates = Vec::new();
131131
for krate in &self.paths {
132-
let path = krate.assert_single_path();
133-
let Some(crate_name) = self.builder.crate_paths.get(&path.path) else {
134-
panic!("missing crate for path {}", path.path.display())
135-
};
132+
let path = &krate.assert_single_path().path;
133+
134+
let crate_name = self
135+
.builder
136+
.crate_paths
137+
.get(path)
138+
.unwrap_or_else(|| panic!("missing crate for path {}", path.display()));
139+
136140
crates.push(crate_name.to_string());
137141
}
138142
crates

0 commit comments

Comments
 (0)