Set RUSTUP_TOOLCHAIN when loading sysroot workspace

This commit is contained in:
Lukas Wirth 2025-02-16 10:51:58 +01:00
parent 40e4f9130f
commit b9f76287c2
2 changed files with 6 additions and 2 deletions

View file

@ -277,6 +277,9 @@ impl CargoWorkspace {
/// Fetches the metadata for the given `cargo_toml` manifest.
/// A successful result may contain another metadata error if the initial fetching failed but
/// the `--no-deps` retry succeeded.
///
/// The sysroot is used to set the `RUSTUP_TOOLCHAIN` env var when invoking cargo
/// to ensure that the rustup proxy uses the correct toolchain.
pub fn fetch_metadata(
cargo_toml: &ManifestPath,
current_dir: &AbsPath,