Skip to content

Commit 7702fb2

Browse files
Rollup merge of #150574 - MoveData-init_loc_map, r=cjgillot
Clarify `MoveData::init_loc_map`. Change the `SmallVec` size from 4 to 1, because that's sufficient in the vast majority of cases. (This doesn't affect performance in practice, so it's more of a code clarity change than a performance change.) r? @cjgillot
2 parents 3daf993 + 8ca47cd commit 7702fb2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • compiler/rustc_mir_dataflow/src/move_paths

compiler/rustc_mir_dataflow/src/move_paths/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ pub struct MoveData<'tcx> {
177177
pub rev_lookup: MovePathLookup<'tcx>,
178178
pub inits: IndexVec<InitIndex, Init>,
179179
/// Each Location `l` is mapped to the Inits that are effects
180-
/// of executing the code at `l`.
181-
pub init_loc_map: LocationMap<SmallVec<[InitIndex; 4]>>,
180+
/// of executing the code at `l`. Only very rarely (e.g. inline asm)
181+
/// is there more than one Init at any `l`.
182+
pub init_loc_map: LocationMap<SmallVec<[InitIndex; 1]>>,
182183
pub init_path_map: IndexVec<MovePathIndex, SmallVec<[InitIndex; 4]>>,
183184
}
184185

0 commit comments

Comments
 (0)