Skip to content

Commit

Permalink
yet more comment improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdesjardins committed Aug 25, 2021
1 parent 75fecd5 commit c07a2eb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions compiler/rustc_middle/src/mir/interpret/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ impl InitMask {
// In both cases, the block index of `end` is 1.
// But we do want to search block 1 in (a), and we don't in (b).
//
// If we subtract 1 from both end positions to make them inclusive:
// We subtract 1 from both end positions to make them inclusive:
//
// (a) 00000000|00000000 (b) 00000000|
// ^~~~~~~~~~^ ^~~~~~~^
Expand Down Expand Up @@ -937,7 +937,12 @@ impl InitMask {
pub fn range_as_init_chunks(&self, start: Size, end: Size) -> InitChunkIter<'_> {
assert!(end <= self.len);

let is_init = if start < end { self.get(start) } else { false };
let is_init = if start < end {
self.get(start)
} else {
// `start..end` is empty: there are no chunks, so use some arbitrary value
false
};

InitChunkIter { init_mask: self, is_init, start, end }
}
Expand Down

0 comments on commit c07a2eb

Please sign in to comment.