File tree 1 file changed +7
-2
lines changed
compiler/rustc_middle/src/mir/interpret
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -766,7 +766,7 @@ impl InitMask {
766
766
// In both cases, the block index of `end` is 1.
767
767
// But we do want to search block 1 in (a), and we don't in (b).
768
768
//
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:
770
770
//
771
771
// (a) 00000000|00000000 (b) 00000000|
772
772
// ^~~~~~~~~~^ ^~~~~~~^
@@ -937,7 +937,12 @@ impl InitMask {
937
937
pub fn range_as_init_chunks ( & self , start : Size , end : Size ) -> InitChunkIter < ' _ > {
938
938
assert ! ( end <= self . len) ;
939
939
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
+ } ;
941
946
942
947
InitChunkIter { init_mask : self , is_init, start, end }
943
948
}
You can’t perform that action at this time.
0 commit comments