]> git.lizzy.rs Git - rust.git/commitdiff
remove the FxHashSet since it's not helping us in practice
authorNiko Matsakis <niko@alum.mit.edu>
Sun, 1 Jul 2018 09:51:33 +0000 (05:51 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Sun, 1 Jul 2018 09:53:35 +0000 (05:53 -0400)
It turns out that we don't have duplicates, just self-cycles.

src/librustc_mir/borrow_check/nll/constraint_set.rs

index 78bd4504443102b724775340e77810829ef59f99..4c6e445293d5456bd05bc0be9989435f3b043ea6 100644 (file)
@@ -10,7 +10,6 @@
 
 use rustc::mir::Location;
 use rustc::ty::RegionVid;
-use rustc_data_structures::fx::FxHashSet;
 use rustc_data_structures::indexed_vec::{Idx, IndexVec};
 
 use std::fmt;
@@ -20,7 +19,6 @@
 #[derive(Clone, Default)]
 crate struct ConstraintSet {
     constraints: IndexVec<ConstraintIndex, OutlivesConstraint>,
-    seen_constraints: FxHashSet<(RegionVid, RegionVid)>,
 }
 
 impl ConstraintSet {
@@ -33,9 +31,7 @@ pub fn push(&mut self, constraint: OutlivesConstraint) {
             // 'a: 'a is pretty uninteresting
             return;
         }
-        if self.seen_constraints.insert(constraint.dedup_key()) {
-            self.constraints.push(constraint);
-        }
+        self.constraints.push(constraint);
     }
 
     /// Once all constraints have been added, `link()` is used to thread together the constraints
@@ -107,12 +103,6 @@ pub struct OutlivesConstraint {
     pub span: Span,
 }
 
-impl OutlivesConstraint {
-    pub fn dedup_key(&self) -> (RegionVid, RegionVid) {
-        (self.sup, self.sub)
-    }
-}
-
 impl fmt::Debug for OutlivesConstraint {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         write!(