@@ -60,7 +60,7 @@ pub enum ProjectWorkspace {
6060 cargo : CargoWorkspace ,
6161 build_scripts : WorkspaceBuildScripts ,
6262 sysroot : Result < Sysroot , Option < String > > ,
63- rustc : Result < ( CargoWorkspace , WorkspaceBuildScripts ) , Option < String > > ,
63+ rustc : Result < Box < ( CargoWorkspace , WorkspaceBuildScripts ) > , Option < String > > ,
6464 /// Holds cfg flags for the current target. We get those by running
6565 /// `rustc --print cfg`.
6666 ///
@@ -119,7 +119,7 @@ impl fmt::Debug for ProjectWorkspace {
119119 . field ( "sysroot" , & sysroot. is_ok ( ) )
120120 . field (
121121 "n_rustc_compiler_crates" ,
122- & rustc. as_ref ( ) . map_or ( 0 , |( rc, _) | rc. packages ( ) . len ( ) ) ,
122+ & rustc. as_ref ( ) . map ( |a| a . as_ref ( ) ) . map_or ( 0 , |( rc, _) | rc. packages ( ) . len ( ) ) ,
123123 )
124124 . field ( "n_rustc_cfg" , & rustc_cfg. len ( ) )
125125 . field ( "n_cfg_overrides" , & cfg_overrides. len ( ) )
@@ -265,7 +265,7 @@ impl ProjectWorkspace {
265265 cargo_toml. parent ( ) ,
266266 & config. extra_env ,
267267 ) ;
268- Ok ( ( workspace, buildscripts) )
268+ Ok ( Box :: new ( ( workspace, buildscripts) ) )
269269 }
270270 Err ( e) => {
271271 tracing:: error!(
@@ -603,7 +603,7 @@ impl ProjectWorkspace {
603603 PackageRoot { is_local, include, exclude }
604604 } )
605605 . chain ( mk_sysroot ( sysroot. as_ref ( ) , Some ( cargo. workspace_root ( ) ) ) )
606- . chain ( rustc. iter ( ) . flat_map ( |( rustc, _) | {
606+ . chain ( rustc. iter ( ) . map ( |a| a . as_ref ( ) ) . flat_map ( |( rustc, _) | {
607607 rustc. packages ( ) . map ( move |krate| PackageRoot {
608608 is_local : false ,
609609 include : vec ! [ rustc[ krate] . manifest. parent( ) . to_path_buf( ) ] ,
@@ -631,7 +631,8 @@ impl ProjectWorkspace {
631631 sysroot_package_len + project. n_crates ( )
632632 }
633633 ProjectWorkspace :: Cargo { cargo, sysroot, rustc, .. } => {
634- let rustc_package_len = rustc. as_ref ( ) . map_or ( 0 , |( it, _) | it. packages ( ) . len ( ) ) ;
634+ let rustc_package_len =
635+ rustc. as_ref ( ) . map ( |a| a. as_ref ( ) ) . map_or ( 0 , |( it, _) | it. packages ( ) . len ( ) ) ;
635636 let sysroot_package_len = sysroot. as_ref ( ) . map_or ( 0 , |it| it. num_packages ( ) ) ;
636637 cargo. packages ( ) . len ( ) + sysroot_package_len + rustc_package_len
637638 }
@@ -672,7 +673,7 @@ impl ProjectWorkspace {
672673 target_layout,
673674 } => cargo_to_crate_graph (
674675 load,
675- rustc. as_ref ( ) . ok ( ) ,
676+ rustc. as_ref ( ) . map ( |a| a . as_ref ( ) ) . ok ( ) ,
676677 cargo,
677678 sysroot. as_ref ( ) . ok ( ) ,
678679 rustc_cfg. clone ( ) ,
0 commit comments