Skip to content

Commit

Permalink
Use LocalDecls in a couple of places.
Browse files Browse the repository at this point in the history
It's nicer than the `IndexVec` type.
  • Loading branch information
nnethercote committed Sep 3, 2024
1 parent cf78257 commit b10dfa5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use rustc_index::IndexVec;
use rustc_middle::mir::patch::MirPatch;
use rustc_middle::mir::visit::MutVisitor;
use rustc_middle::mir::*;
Expand All @@ -9,7 +8,7 @@ pub(super) struct Subtyper;
struct SubTypeChecker<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
patcher: MirPatch<'tcx>,
local_decls: &'a IndexVec<Local, LocalDecl<'tcx>>,
local_decls: &'a LocalDecls<'tcx>,
}

impl<'a, 'tcx> MutVisitor<'tcx> for SubTypeChecker<'a, 'tcx> {
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_mir_transform/src/deref_separator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use rustc_index::IndexVec;
use rustc_middle::mir::patch::MirPatch;
use rustc_middle::mir::visit::NonUseContext::VarDebugInfo;
use rustc_middle::mir::visit::{MutVisitor, PlaceContext};
Expand All @@ -10,7 +9,7 @@ pub(super) struct Derefer;
struct DerefChecker<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
patcher: MirPatch<'tcx>,
local_decls: &'a IndexVec<Local, LocalDecl<'tcx>>,
local_decls: &'a LocalDecls<'tcx>,
}

impl<'a, 'tcx> MutVisitor<'tcx> for DerefChecker<'a, 'tcx> {
Expand Down

0 comments on commit b10dfa5

Please sign in to comment.