Skip to content

Commit 1126953

Browse files
committed
simplify-locals: Represent use counts with u32
1 parent 124b63a commit 1126953

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler/rustc_mir/src/transform/simplify.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ impl<'tcx> MirPass<'tcx> for SimplifyLocals {
363363
/// Construct the mapping while swapping out unused stuff out from the `vec`.
364364
fn make_local_map<V>(
365365
local_decls: &mut IndexVec<Local, V>,
366-
used_locals: IndexVec<Local, usize>,
366+
used_locals: IndexVec<Local, u32>,
367367
arg_count: usize,
368368
) -> IndexVec<Local, Option<Local>> {
369369
let mut map: IndexVec<Local, Option<Local>> = IndexVec::from_elem(None, &*local_decls);
@@ -385,7 +385,7 @@ fn make_local_map<V>(
385385
}
386386

387387
struct DeclMarker<'a, 'tcx> {
388-
pub local_counts: IndexVec<Local, usize>,
388+
pub local_counts: IndexVec<Local, u32>,
389389
pub body: &'a Body<'tcx>,
390390
}
391391

@@ -444,13 +444,13 @@ impl<'a, 'tcx> Visitor<'tcx> for DeclMarker<'a, 'tcx> {
444444
}
445445

446446
struct StatementDeclMarker<'a, 'tcx> {
447-
used_locals: &'a mut IndexVec<Local, usize>,
447+
used_locals: &'a mut IndexVec<Local, u32>,
448448
statement: &'a Statement<'tcx>,
449449
}
450450

451451
impl<'a, 'tcx> StatementDeclMarker<'a, 'tcx> {
452452
pub fn new(
453-
used_locals: &'a mut IndexVec<Local, usize>,
453+
used_locals: &'a mut IndexVec<Local, u32>,
454454
statement: &'a Statement<'tcx>,
455455
) -> Self {
456456
Self { used_locals, statement }
@@ -475,15 +475,15 @@ impl<'a, 'tcx> Visitor<'tcx> for StatementDeclMarker<'a, 'tcx> {
475475
}
476476

477477
struct RemoveStatements<'a, 'tcx> {
478-
used_locals: &'a mut IndexVec<Local, usize>,
478+
used_locals: &'a mut IndexVec<Local, u32>,
479479
arg_count: usize,
480480
tcx: TyCtxt<'tcx>,
481481
modified: bool,
482482
}
483483

484484
impl<'a, 'tcx> RemoveStatements<'a, 'tcx> {
485485
fn new(
486-
used_locals: &'a mut IndexVec<Local, usize>,
486+
used_locals: &'a mut IndexVec<Local, u32>,
487487
arg_count: usize,
488488
tcx: TyCtxt<'tcx>,
489489
) -> Self {

0 commit comments

Comments
 (0)