File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -177,16 +177,19 @@ fn attach_std_deps(
177
177
let mut found = false ;
178
178
for ( unit, deps) in state. unit_dependencies . iter_mut ( ) {
179
179
if !unit. kind . is_host ( ) && !unit. mode . is_run_custom_build ( ) {
180
- deps. extend ( std_roots[ & unit. kind ] . iter ( ) . map ( |unit| UnitDep {
181
- unit : unit. clone ( ) ,
182
- unit_for : UnitFor :: new_normal ( unit. kind ) ,
183
- extern_crate_name : unit. pkg . name ( ) ,
184
- dep_name : None ,
185
- // TODO: Does this `public` make sense?
186
- public : true ,
187
- noprelude : true ,
188
- } ) ) ;
189
- found = true ;
180
+ // only attach roots for which the user has requested `build-std` for.
181
+ if let Some ( roots) = std_roots. get ( & unit. kind ) {
182
+ deps. extend ( roots. iter ( ) . map ( |unit| UnitDep {
183
+ unit : unit. clone ( ) ,
184
+ unit_for : UnitFor :: new_normal ( unit. kind ) ,
185
+ extern_crate_name : unit. pkg . name ( ) ,
186
+ dep_name : None ,
187
+ // TODO: Does this `public` make sense?
188
+ public : true ,
189
+ noprelude : true ,
190
+ } ) ) ;
191
+ found = true ;
192
+ }
190
193
}
191
194
}
192
195
// And also include the dependencies of the standard library itself. Don't
You can’t perform that action at this time.
0 commit comments