1
Fork 0

Remove unneeded field from SwitchTargets

This commit is contained in:
Jakob Degen 2022-12-03 16:03:27 -08:00
parent 14ca83a04b
commit 9fb8da8f8f
131 changed files with 304 additions and 388 deletions

View file

@ -596,7 +596,6 @@ where
source_info: self.source_info,
kind: TerminatorKind::SwitchInt {
discr: Operand::Move(discr),
switch_ty: discr_ty,
targets: SwitchTargets::new(
values.iter().copied().zip(blocks.iter().copied()),
*blocks.last().unwrap(),
@ -716,7 +715,7 @@ where
is_cleanup: unwind.is_cleanup(),
terminator: Some(Terminator {
source_info: self.source_info,
kind: TerminatorKind::if_(tcx, move_(can_go), succ, drop_block),
kind: TerminatorKind::if_(move_(can_go), succ, drop_block),
}),
};
let loop_block = self.elaborator.patch().new_block(loop_block);
@ -781,7 +780,6 @@ where
source_info: self.source_info,
kind: TerminatorKind::SwitchInt {
discr: move_(elem_size),
switch_ty: tcx.types.usize,
targets: SwitchTargets::static_if(
0,
self.drop_loop_pair(ety, false, len),
@ -1021,7 +1019,7 @@ where
DropStyle::Static => on_set,
DropStyle::Conditional | DropStyle::Open => {
let flag = self.elaborator.get_drop_flag(self.path).unwrap();
let term = TerminatorKind::if_(self.tcx(), flag, on_set, on_unset);
let term = TerminatorKind::if_(flag, on_set, on_unset);
self.new_block(unwind, term)
}
}

View file

@ -261,7 +261,7 @@ impl Direction for Backward {
propagate(pred, &tmp);
}
mir::TerminatorKind::SwitchInt { targets: _, ref discr, switch_ty: _ } => {
mir::TerminatorKind::SwitchInt { targets: _, ref discr } => {
let mut applier = BackwardSwitchIntEdgeEffectsApplier {
body,
pred,
@ -577,7 +577,7 @@ impl Direction for Forward {
}
}
SwitchInt { ref targets, ref discr, switch_ty: _ } => {
SwitchInt { ref targets, ref discr } => {
let mut applier = ForwardSwitchIntEdgeEffectsApplier {
exit_state,
targets,