remove duplicated adding to the cache
authorEh2406 <YeomanYaacov@gmail.com>
Fri, 16 Mar 2018 16:31:30 +0000 (12:31 -0400)
committerEh2406 <YeomanYaacov@gmail.com>
Fri, 16 Mar 2018 16:44:07 +0000 (12:44 -0400)
src/cargo/core/resolver/mod.rs

index 33ba172b23dfeb3749c5694097df8d2858321ef2..4174cc0b4bc44c7a84db66768b930962a82ac1fc 100644 (file)
@@ -1096,30 +1096,16 @@ fn activate_deps_loop(
                         }
                     }
                     if !has_another && has_past_conflicting_dep && !backtracked {
-                        // we have not activated ANY candidates and
-                        // we are out of choices so add it to the cache
-                        // so our parent will know that we don't work
-                        let past = past_conflicting_activations
-                            .entry(dep.clone())
-                            .or_insert_with(Vec::new);
-                        if !past.contains(&conflicting_activations) {
-                            trace!(
-                                "{}[{}]>{} adding a meta-skip {:?}",
-                                parent.name(),
-                                cur,
-                                dep.name(),
-                                conflicting_activations
-                            );
-                            past.push(conflicting_activations.clone());
-                            // also clean the `backtrack_stack` so we don't
-                            // backtrack to a place where we will try this again.
-                            backtrack_stack.retain(|bframe| {
-                                !bframe.context_backup.is_conflicting(
-                                    Some(parent.package_id()),
-                                    &conflicting_activations,
-                                )
-                            });
-                        }
+                        // we have not activated ANY candidates.
+                        // So clean the `backtrack_stack` so we don't
+                        // backtrack to a place where we will try this again.
+                        backtrack_stack.retain(|bframe| {
+                            // Maybe we could just not add them in the first place, but for now this works
+                            !bframe.context_backup.is_conflicting(
+                                Some(parent.package_id()),
+                                &conflicting_activations,
+                            )
+                        });
                     }
                     // if not has_another we we activate for the better error messages
                     frame.just_for_error_messages = has_past_conflicting_dep;