@@ -129,19 +129,9 @@ pub struct Compilation<'gctx> {
129
129
130
130
impl < ' gctx > Compilation < ' gctx > {
131
131
pub fn new < ' a > ( bcx : & BuildContext < ' a , ' gctx > ) -> CargoResult < Compilation < ' gctx > > {
132
- let mut rustc = bcx. rustc ( ) . process ( ) ;
133
- let mut primary_rustc_process = bcx. build_config . primary_unit_rustc . clone ( ) ;
134
- let mut rustc_workspace_wrapper_process = bcx. rustc ( ) . workspace_process ( ) ;
135
-
136
- if bcx. gctx . extra_verbose ( ) {
137
- rustc. display_env_vars ( ) ;
138
- rustc_workspace_wrapper_process. display_env_vars ( ) ;
139
-
140
- if let Some ( rustc) = primary_rustc_process. as_mut ( ) {
141
- rustc. display_env_vars ( ) ;
142
- }
143
- }
144
-
132
+ let rustc_process = bcx. rustc ( ) . process ( ) ;
133
+ let primary_rustc_process = bcx. build_config . primary_unit_rustc . clone ( ) ;
134
+ let rustc_workspace_wrapper_process = bcx. rustc ( ) . workspace_process ( ) ;
145
135
Ok ( Compilation {
146
136
native_dirs : BTreeSet :: new ( ) ,
147
137
root_output : HashMap :: new ( ) ,
@@ -155,7 +145,7 @@ impl<'gctx> Compilation<'gctx> {
155
145
to_doc_test : Vec :: new ( ) ,
156
146
gctx : bcx. gctx ,
157
147
host : bcx. host_triple ( ) . to_string ( ) ,
158
- rustc_process : rustc ,
148
+ rustc_process,
159
149
rustc_workspace_wrapper_process,
160
150
primary_rustc_process,
161
151
target_runners : bcx
@@ -189,14 +179,16 @@ impl<'gctx> Compilation<'gctx> {
189
179
is_primary : bool ,
190
180
is_workspace : bool ,
191
181
) -> CargoResult < ProcessBuilder > {
192
- let rustc = if is_primary && self . primary_rustc_process . is_some ( ) {
182
+ let mut rustc = if is_primary && self . primary_rustc_process . is_some ( ) {
193
183
self . primary_rustc_process . clone ( ) . unwrap ( )
194
184
} else if is_workspace {
195
185
self . rustc_workspace_wrapper_process . clone ( )
196
186
} else {
197
187
self . rustc_process . clone ( )
198
188
} ;
199
-
189
+ if self . gctx . extra_verbose ( ) {
190
+ rustc. display_env_vars ( ) ;
191
+ }
200
192
let cmd = fill_rustc_tool_env ( rustc, unit) ;
201
193
self . fill_env ( cmd, & unit. pkg , None , unit. kind , ToolKind :: Rustc )
202
194
}
0 commit comments