@@ -65,7 +65,7 @@ impl WorkspaceBuildScripts {
6565allowed_features : & FxHashSet < String > ,
6666manifest_path : & ManifestPath ,
6767toolchain : Option < & Version > ,
68- sysroot : Option < & Sysroot > ,
68+ sysroot : & Sysroot ,
6969) -> io:: Result < Command > {
7070const RUST_1_75 : Version = Version :: new ( 1 , 75 , 0 ) ;
7171let mut cmd = match config. run_build_script_command . as_deref ( ) {
@@ -75,7 +75,7 @@ impl WorkspaceBuildScripts {
7575 cmd
7676}
7777 _ => {
78- let mut cmd = Sysroot :: tool ( sysroot , Tool :: Cargo ) ;
78+ let mut cmd = sysroot . tool ( Tool :: Cargo ) ;
7979
8080 cmd. args ( [ "check" , "--quiet" , "--workspace" , "--message-format=json" ] ) ;
8181 cmd. args ( & config. extra_args ) ;
@@ -149,7 +149,7 @@ impl WorkspaceBuildScripts {
149149workspace : & CargoWorkspace ,
150150progress : & dyn Fn ( String ) ,
151151toolchain : Option < & Version > ,
152- sysroot : Option < & Sysroot > ,
152+ sysroot : & Sysroot ,
153153) -> io:: Result < WorkspaceBuildScripts > {
154154let current_dir = match & config. invocation_location {
155155InvocationLocation :: Root ( root) if config. run_build_script_command . is_some ( ) => {
@@ -195,7 +195,7 @@ impl WorkspaceBuildScripts {
195195// This is not gonna be used anyways, so just construct a dummy here
196196& ManifestPath :: try_from ( workspace_root. clone ( ) ) . unwrap ( ) ,
197197None ,
198- None ,
198+ & Sysroot :: empty ( ) ,
199199) ?;
200200// NB: Cargo.toml could have been modified between `cargo metadata` and
201201// `cargo check`. We shouldn't assume that package ids we see here are
@@ -412,15 +412,15 @@ impl WorkspaceBuildScripts {
412412rustc : & CargoWorkspace ,
413413current_dir : & AbsPath ,
414414extra_env : & FxHashMap < String , String > ,
415- sysroot : Option < & Sysroot > ,
415+ sysroot : & Sysroot ,
416416) -> Self {
417417let mut bs = WorkspaceBuildScripts :: default ( ) ;
418418for p in rustc. packages ( ) {
419419 bs. outputs . insert ( p, BuildScriptOutput :: default ( ) ) ;
420420}
421421let res = ( || {
422422let target_libdir = ( || {
423- let mut cargo_config = Sysroot :: tool ( sysroot , Tool :: Cargo ) ;
423+ let mut cargo_config = sysroot . tool ( Tool :: Cargo ) ;
424424 cargo_config. envs ( extra_env) ;
425425 cargo_config
426426. current_dir ( current_dir)
@@ -429,7 +429,7 @@ impl WorkspaceBuildScripts {
429429if let Ok ( it) = utf8_stdout ( cargo_config) {
430430return Ok ( it) ;
431431}
432- let mut cmd = Sysroot :: tool ( sysroot , Tool :: Rustc ) ;
432+ let mut cmd = sysroot . tool ( Tool :: Rustc ) ;
433433 cmd. envs ( extra_env) ;
434434 cmd. args ( [ "--print" , "target-libdir" ] ) ;
435435utf8_stdout ( cmd)
0 commit comments