@@ -24,10 +24,15 @@ impl ConflictStoreTrie {
24
24
) -> Option < & BTreeMap < PackageId , ConflictReason > > {
25
25
match self {
26
26
ConflictStoreTrie :: Leaf ( c) => {
27
- // is_conflicting checks that all the elements are active,
28
- // but we have checked each one by the recursion of this function.
29
- debug_assert ! ( cx. is_conflicting( None , c) ) ;
30
- Some ( c)
27
+ if must_contain. is_none ( ) {
28
+ // is_conflicting checks that all the elements are active,
29
+ // but we have checked each one by the recursion of this function.
30
+ debug_assert ! ( cx. is_conflicting( None , c) ) ;
31
+ Some ( c)
32
+ } else {
33
+ // we did not find `must_contain` so we need to keep looking.
34
+ None
35
+ }
31
36
}
32
37
ConflictStoreTrie :: Node ( m) => {
33
38
for ( & pid, store) in must_contain
@@ -37,7 +42,7 @@ impl ConflictStoreTrie {
37
42
// if the key is active then we need to check all of the corresponding subTrie.
38
43
if cx. is_active ( pid) {
39
44
if let Some ( o) =
40
- store. find_conflicting ( cx, must_contain. filter ( |& f| f = = pid) )
45
+ store. find_conflicting ( cx, must_contain. filter ( |& f| f ! = pid) )
41
46
{
42
47
return Some ( o) ;
43
48
}
@@ -138,9 +143,18 @@ impl ConflictCache {
138
143
dep : & Dependency ,
139
144
must_contain : Option < PackageId > ,
140
145
) -> Option < & BTreeMap < PackageId , ConflictReason > > {
141
- self . con_from_dep
146
+ let out = self
147
+ . con_from_dep
142
148
. get ( dep) ?
143
- . find_conflicting ( cx, must_contain)
149
+ . find_conflicting ( cx, must_contain) ;
150
+ if cfg ! ( debug_assertions) {
151
+ if let Some ( f) = must_contain {
152
+ if let Some ( c) = & out {
153
+ assert ! ( c. contains_key( & f) ) ;
154
+ }
155
+ }
156
+ }
157
+ out
144
158
}
145
159
pub fn conflicting (
146
160
& self ,
0 commit comments