Skip to content

Commit

Permalink
Use visit_terminator_kind when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Apr 26, 2019
1 parent 0eeab6b commit 7ab92cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/librustc_mir/borrow_check/nll/invalidation.rs
Expand Up @@ -14,7 +14,7 @@ use rustc::ty::TyCtxt;
use rustc::mir::visit::Visitor;
use rustc::mir::{BasicBlock, Location, Mir, Place, PlaceBase, Rvalue};
use rustc::mir::{Statement, StatementKind};
use rustc::mir::{Terminator, TerminatorKind};
use rustc::mir::TerminatorKind;
use rustc::mir::{Operand, BorrowKind};
use rustc_data_structures::graph::dominators::Dominators;

Expand Down Expand Up @@ -136,14 +136,14 @@ impl<'cx, 'tcx, 'gcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx, 'gcx> {
self.super_statement(statement, location);
}

fn visit_terminator(
fn visit_terminator_kind(
&mut self,
kind: &Terminator<'tcx>,
kind: &TerminatorKind<'tcx>,
location: Location
) {
self.check_activations(location);

match terminator.kind {
match kind {
TerminatorKind::SwitchInt {
ref discr,
switch_ty: _,
Expand Down Expand Up @@ -256,7 +256,7 @@ impl<'cx, 'tcx, 'gcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx, 'gcx> {
}
}

self.super_terminator(terminator, location);
self.super_terminator_kind(kind, location);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/librustc_mir/transform/no_landing_pads.rs
Expand Up @@ -24,12 +24,12 @@ pub fn no_landing_pads<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, mir: &mut Mir<'tcx
}

impl<'tcx> MutVisitor<'tcx> for NoLandingPads {
fn visit_terminator(&mut self,
terminator: &mut Terminator<'tcx>,
fn visit_terminator_kind(&mut self,
kind: &mut TerminatorKind<'tcx>,
location: Location) {
if let Some(unwind) = terminator.kind.unwind_mut() {
if let Some(unwind) = kind.unwind_mut() {
unwind.take();
}
self.super_terminator(terminator, location);
self.super_terminator_kind(kind, location);
}
}

0 comments on commit 7ab92cd

Please sign in to comment.