From f72724eeb4971e686718c5d2f8a4ae96f9395e15 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 9 Aug 2017 14:02:45 -0700 Subject: [PATCH] Fix iterator over indexed sets --- src/librustc_data_structures/indexed_set.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc_data_structures/indexed_set.rs b/src/librustc_data_structures/indexed_set.rs index 9fa47cee6595..cc56289a5633 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::() * 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)) } }