File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,9 @@ impl CargoWorkspace {
277277 /// Fetches the metadata for the given `cargo_toml` manifest.
278278 /// A successful result may contain another metadata error if the initial fetching failed but
279279 /// the `--no-deps` retry succeeded.
280+ ///
281+ /// The sysroot is used to set the `RUSTUP_TOOLCHAIN` env var when invoking cargo
282+ /// to ensure that the rustup proxy uses the correct toolchain.
280283 pub fn fetch_metadata (
281284 cargo_toml : & ManifestPath ,
282285 current_dir : & AbsPath ,
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ impl Sysroot {
247247 let library_manifest = ManifestPath :: try_from ( src_root. join ( "Cargo.toml" ) ) . unwrap ( ) ;
248248 if fs:: metadata ( & library_manifest) . is_ok ( ) {
249249 if let Some ( loaded) =
250- Self :: load_library_via_cargo ( library_manifest, src_root, cargo_config)
250+ self . load_library_via_cargo ( library_manifest, src_root, cargo_config)
251251 {
252252 return Some ( loaded) ;
253253 }
@@ -326,6 +326,7 @@ impl Sysroot {
326326 }
327327
328328 fn load_library_via_cargo (
329+ & self ,
329330 library_manifest : ManifestPath ,
330331 rust_lib_src_dir : & AbsPathBuf ,
331332 cargo_config : & CargoMetadataConfig ,
@@ -342,7 +343,7 @@ impl Sysroot {
342343 & library_manifest,
343344 rust_lib_src_dir,
344345 & cargo_config,
345- & Sysroot :: empty ( ) ,
346+ self ,
346347 // Make sure we never attempt to write to the sysroot
347348 true ,
348349 & |_| ( ) ,
You can’t perform that action at this time.
0 commit comments