summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2018-01-26 02:14:54 -0300
committerSantiago Pastorino <spastorino@gmail.com>2018-01-26 21:56:49 -0300
commitda545cee6057eddc0cf64767870a1cdc087ade1f (patch)
tree669afc706bd24bf470d5b2ca412c2357e60452bd /src/librustc_data_structures
parenta97cd17f5d71fb4ec362f4fbd79373a6e7ed7b82 (diff)
downloadrust-da545cee6057eddc0cf64767870a1cdc087ade1f.tar.gz
rust-da545cee6057eddc0cf64767870a1cdc087ade1f.zip
Make region inference use a dirty list
Fixes #47602
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/bitvec.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc_data_structures/bitvec.rs b/src/librustc_data_structures/bitvec.rs
index 94edaa746f9..80cdb0e4417 100644
--- a/src/librustc_data_structures/bitvec.rs
+++ b/src/librustc_data_structures/bitvec.rs
@@ -51,6 +51,17 @@ impl BitVector {
         new_value != value
     }
 
+    /// Returns true if the bit has changed.
+    #[inline]
+    pub fn remove(&mut self, bit: usize) -> bool {
+        let (word, mask) = word_mask(bit);
+        let data = &mut self.data[word];
+        let value = *data;
+        let new_value = value & !mask;
+        *data = new_value;
+        new_value != value
+    }
+
     #[inline]
     pub fn insert_all(&mut self, all: &BitVector) -> bool {
         assert!(self.data.len() == all.data.len());