about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-08-09 14:02:45 -0700
committerAlex Crichton <alex@alexcrichton.com>2017-08-09 14:02:45 -0700
commitf72724eeb4971e686718c5d2f8a4ae96f9395e15 (patch)
treed3e3fa5a97278281425586f3d57207f45b33a593 /src/librustc_data_structures
parent352577f4bb7c0214570db062d84dc69004348769 (diff)
downloadrust-f72724eeb4971e686718c5d2f8a4ae96f9395e15.tar.gz
rust-f72724eeb4971e686718c5d2f8a4ae96f9395e15.zip
Fix iterator over indexed sets
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/indexed_set.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_data_structures/indexed_set.rs b/src/librustc_data_structures/indexed_set.rs
index 9fa47cee659..cc56289a563 100644
--- a/src/librustc_data_structures/indexed_set.rs
+++ b/src/librustc_data_structures/indexed_set.rs
@@ -186,11 +186,11 @@ impl<'a, T: Idx> Iterator for Iter<'a, T> {
         let word_bits = mem::size_of::<Word>() * 8;
         loop {
             if let Some((ref mut word, offset)) = self.cur {
-                let bit_pos = word.trailing_zeros();
-                if bit_pos != word_bits as u32 {
+                let bit_pos = word.trailing_zeros() as usize;
+                if bit_pos != word_bits {
                     let bit = 1 << bit_pos;
                     *word ^= bit;
-                    return Some(T::new(bit + offset))
+                    return Some(T::new(bit_pos + offset))
                 }
             }