File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
compiler/rustc_middle/src/mir/interpret Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -766,7 +766,7 @@ impl InitMask {
766766 // In both cases, the block index of `end` is 1.
767767 // But we do want to search block 1 in (a), and we don't in (b).
768768 //
769- // If we subtract 1 from both end positions to make them inclusive:
769+ // We subtract 1 from both end positions to make them inclusive:
770770 //
771771 // (a) 00000000|00000000 (b) 00000000|
772772 // ^~~~~~~~~~^ ^~~~~~~^
@@ -937,7 +937,12 @@ impl InitMask {
937937 pub fn range_as_init_chunks ( & self , start : Size , end : Size ) -> InitChunkIter < ' _ > {
938938 assert ! ( end <= self . len) ;
939939
940- let is_init = if start < end { self . get ( start) } else { false } ;
940+ let is_init = if start < end {
941+ self . get ( start)
942+ } else {
943+ // `start..end` is empty: there are no chunks, so use some arbitrary value
944+ false
945+ } ;
941946
942947 InitChunkIter { init_mask : self , is_init, start, end }
943948 }
You can’t perform that action at this time.
0 commit comments