@@ -165,40 +165,40 @@ pub fn generate_std_roots(
165
165
} )
166
166
. collect ( ) ;
167
167
168
- for kinds in package_set
168
+ for kind in package_set
169
169
. packages ( )
170
- . map ( |pkg| pkg. explicit_kinds ( requested_kinds, explicit_host_kind) )
170
+ . flat_map ( |pkg| pkg. explicit_kinds ( requested_kinds, explicit_host_kind) )
171
171
{
172
- for kind in kinds {
173
- if let Entry :: Vacant ( e) = ret. entry ( kind) {
174
- let units = std_pkg_infos. iter ( ) . map ( |( pkg, lib, unit_for, features) | {
175
- // I don't think we need to bother with Check here, the difference
176
- // in time is minimal, and the difference in caching is
177
- // significant.
178
- let mode = CompileMode :: Build ;
179
- let profile = profiles. get_profile (
180
- pkg. package_id ( ) ,
181
- /*is_member*/ false ,
182
- /*is_local*/ false ,
183
- * unit_for,
184
- mode,
185
- kind,
186
- ) ;
187
- interner. intern (
188
- pkg,
189
- lib,
190
- profile,
191
- kind,
192
- mode,
193
- features. clone ( ) ,
194
- /*is_std*/ true ,
195
- /*dep_hash*/ 0 ,
196
- )
197
- } ) ;
172
+ let e = match ret. entry ( kind) {
173
+ Entry :: Vacant ( e) => e,
174
+ Entry :: Occupied ( _) => continue ,
175
+ } ;
176
+ let units = std_pkg_infos. iter ( ) . map ( |( pkg, lib, unit_for, features) | {
177
+ // I don't think we need to bother with Check here, the difference
178
+ // in time is minimal, and the difference in caching is
179
+ // significant.
180
+ let mode = CompileMode :: Build ;
181
+ let profile = profiles. get_profile (
182
+ pkg. package_id ( ) ,
183
+ /*is_member*/ false ,
184
+ /*is_local*/ false ,
185
+ * unit_for,
186
+ mode,
187
+ kind,
188
+ ) ;
189
+ interner. intern (
190
+ pkg,
191
+ lib,
192
+ profile,
193
+ kind,
194
+ mode,
195
+ features. clone ( ) ,
196
+ /*is_std*/ true ,
197
+ /*dep_hash*/ 0 ,
198
+ )
199
+ } ) ;
198
200
199
- e. insert ( units. collect ( ) ) ;
200
- }
201
- }
201
+ e. insert ( units. collect ( ) ) ;
202
202
}
203
203
204
204
Ok ( ret)
0 commit comments