@@ -596,12 +596,12 @@ impl DepsFrame {
596
596
. unwrap_or ( 0 )
597
597
}
598
598
599
- fn flatten < ' s > ( & ' s self ) -> Box < Iterator < Item = ( PackageId , Dependency ) > + ' s > {
599
+ fn flatten < ' s > ( & ' s self ) -> Box < Iterator < Item = ( & PackageId , Dependency ) > + ' s > {
600
600
// TODO: with impl Trait the Box can be removed
601
601
Box :: new (
602
602
self . remaining_siblings
603
603
. clone ( )
604
- . map ( move |( _, ( d, _, _) ) | ( self . parent . package_id ( ) . clone ( ) , d) ) ,
604
+ . map ( move |( _, ( d, _, _) ) | ( self . parent . package_id ( ) , d) ) ,
605
605
)
606
606
}
607
607
}
@@ -1238,18 +1238,20 @@ fn activate_deps_loop(
1238
1238
} )
1239
1239
. next ( )
1240
1240
{
1241
- let mut conflicting = conflicting. clone ( ) ;
1242
-
1243
- // If one of our deps conflicts with
1241
+ // If one of our deps is known unresolvable
1244
1242
// then we will not succeed.
1245
1243
// How ever if we are part of the reason that
1246
1244
// one of our deps conflicts then
1247
1245
// we can make a stronger statement
1248
1246
// because we will definitely be activated when
1249
1247
// we try our dep.
1250
- conflicting. remove ( & pid) ;
1248
+ conflicting_activations. extend (
1249
+ conflicting
1250
+ . iter ( )
1251
+ . filter ( |& ( p, _) | p != & pid)
1252
+ . map ( |( p, r) | ( p. clone ( ) , r. clone ( ) ) ) ,
1253
+ ) ;
1251
1254
1252
- conflicting_activations. extend ( conflicting) ;
1253
1255
has_past_conflicting_dep = true ;
1254
1256
}
1255
1257
}
@@ -1261,16 +1263,18 @@ fn activate_deps_loop(
1261
1263
// ourselves are incompatible with that dep, so we know that deps
1262
1264
// parent conflict with us.
1263
1265
if !has_past_conflicting_dep {
1264
- if let Some ( rel_deps) = past_conflicting_activations. get_dep_from_pid ( & pid)
1266
+ if let Some ( known_related_bad_deps) =
1267
+ past_conflicting_activations. dependencies_conflicting_with ( & pid)
1265
1268
{
1266
1269
if let Some ( ( other_parent, conflict) ) = remaining_deps
1267
1270
. iter ( )
1268
1271
. flat_map ( |other| other. flatten ( ) )
1269
1272
// for deps related to us
1270
- . filter ( |& ( _, ref other_dep) | rel_deps. contains ( other_dep) )
1273
+ . filter ( |& ( _, ref other_dep) |
1274
+ known_related_bad_deps. contains ( other_dep) )
1271
1275
. filter_map ( |( other_parent, other_dep) | {
1272
1276
past_conflicting_activations
1273
- . filter_conflicting (
1277
+ . find_conflicting (
1274
1278
& cx,
1275
1279
& other_dep,
1276
1280
|con| con. contains_key ( & pid)
@@ -1279,19 +1283,22 @@ fn activate_deps_loop(
1279
1283
} )
1280
1284
. next ( )
1281
1285
{
1282
- let mut conflict = conflict. clone ( ) ;
1283
1286
let rel = conflict. get ( & pid) . unwrap ( ) . clone ( ) ;
1287
+
1284
1288
// The conflict we found is
1285
1289
// "other dep will not succeed if we are activated."
1286
1290
// We want to add
1287
1291
// "our dep will not succeed if other dep is in remaining_deps"
1288
1292
// but that is not how the cache is set up.
1289
1293
// So we add the less general but much faster,
1290
1294
// "our dep will not succeed if other dep's parent is activated".
1291
- conflict. insert ( other_parent. clone ( ) , rel) ;
1292
- conflict. remove ( & pid) ;
1293
-
1294
- conflicting_activations. extend ( conflict) ;
1295
+ conflicting_activations. extend (
1296
+ conflict
1297
+ . iter ( )
1298
+ . filter ( |& ( p, _) | p != & pid)
1299
+ . map ( |( p, r) | ( p. clone ( ) , r. clone ( ) ) ) ,
1300
+ ) ;
1301
+ conflicting_activations. insert ( other_parent. clone ( ) , rel) ;
1295
1302
has_past_conflicting_dep = true ;
1296
1303
}
1297
1304
}
0 commit comments