Skip to content

Commit

Permalink
refactor(build-std): skip consulting std_crate
Browse files Browse the repository at this point in the history
The only functionality of `standard_lib::std_crates` is adding `test` to
the requested crate list. `resolve_std` already unconditionally adds
`sysroot` to the list, which always includes `test` in dependency graph.
Therefore calling `std_crates` is redundant.
  • Loading branch information
weihanglo committed Dec 5, 2024
1 parent c77edbf commit e18b64f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cargo/ops/cargo_fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ pub fn fetch<'a>(
}

// If -Zbuild-std was passed, download dependencies for the standard library.
// We don't know ahead of time what jobs we'll be running, so tell `std_crates` that.
if let Some(crates) = standard_lib::std_crates(gctx, None) {
if let Some(crates) = gctx.cli_unstable().build_std.as_ref() {
let (std_package_set, _, _) =
standard_lib::resolve_std(ws, &mut data, &build_config, &crates)?;
packages.add_set(std_package_set);
Expand Down

0 comments on commit e18b64f

Please sign in to comment.