@@ -60,7 +60,7 @@ pub enum ProjectWorkspace {
60
60
cargo : CargoWorkspace ,
61
61
build_scripts : WorkspaceBuildScripts ,
62
62
sysroot : Result < Sysroot , Option < String > > ,
63
- rustc : Result < ( CargoWorkspace , WorkspaceBuildScripts ) , Option < String > > ,
63
+ rustc : Result < Box < ( CargoWorkspace , WorkspaceBuildScripts ) > , Option < String > > ,
64
64
/// Holds cfg flags for the current target. We get those by running
65
65
/// `rustc --print cfg`.
66
66
///
@@ -119,7 +119,7 @@ impl fmt::Debug for ProjectWorkspace {
119
119
. field ( "sysroot" , & sysroot. is_ok ( ) )
120
120
. field (
121
121
"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 ( ) ) ,
123
123
)
124
124
. field ( "n_rustc_cfg" , & rustc_cfg. len ( ) )
125
125
. field ( "n_cfg_overrides" , & cfg_overrides. len ( ) )
@@ -265,7 +265,7 @@ impl ProjectWorkspace {
265
265
cargo_toml. parent ( ) ,
266
266
& config. extra_env ,
267
267
) ;
268
- Ok ( ( workspace, buildscripts) )
268
+ Ok ( Box :: new ( ( workspace, buildscripts) ) )
269
269
}
270
270
Err ( e) => {
271
271
tracing:: error!(
@@ -603,7 +603,7 @@ impl ProjectWorkspace {
603
603
PackageRoot { is_local, include, exclude }
604
604
} )
605
605
. 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, _) | {
607
607
rustc. packages ( ) . map ( move |krate| PackageRoot {
608
608
is_local : false ,
609
609
include : vec ! [ rustc[ krate] . manifest. parent( ) . to_path_buf( ) ] ,
@@ -631,7 +631,8 @@ impl ProjectWorkspace {
631
631
sysroot_package_len + project. n_crates ( )
632
632
}
633
633
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 ( ) ) ;
635
636
let sysroot_package_len = sysroot. as_ref ( ) . map_or ( 0 , |it| it. num_packages ( ) ) ;
636
637
cargo. packages ( ) . len ( ) + sysroot_package_len + rustc_package_len
637
638
}
@@ -672,7 +673,7 @@ impl ProjectWorkspace {
672
673
target_layout,
673
674
} => cargo_to_crate_graph (
674
675
load,
675
- rustc. as_ref ( ) . ok ( ) ,
676
+ rustc. as_ref ( ) . map ( |a| a . as_ref ( ) ) . ok ( ) ,
676
677
cargo,
677
678
sysroot. as_ref ( ) . ok ( ) ,
678
679
rustc_cfg. clone ( ) ,
0 commit comments