Remove unneeded field from SwitchTargets
This commit is contained in:
parent
14ca83a04b
commit
9fb8da8f8f
131 changed files with 304 additions and 388 deletions
|
@ -24,12 +24,9 @@ impl<'tcx> MirPass<'tcx> for SimplifyConstCondition {
|
|||
let terminator = block.terminator_mut();
|
||||
terminator.kind = match terminator.kind {
|
||||
TerminatorKind::SwitchInt {
|
||||
discr: Operand::Constant(ref c),
|
||||
switch_ty,
|
||||
ref targets,
|
||||
..
|
||||
discr: Operand::Constant(ref c), ref targets, ..
|
||||
} => {
|
||||
let constant = c.literal.try_eval_bits(tcx, param_env, switch_ty);
|
||||
let constant = c.literal.try_eval_bits(tcx, param_env, c.ty());
|
||||
if let Some(constant) = constant {
|
||||
let target = targets.target_for_value(constant);
|
||||
TerminatorKind::Goto { target }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue