1
Fork 0

the Const::eval_bits methods don't need to be given the Ty

This commit is contained in:
Ralf Jung 2023-09-19 17:44:31 +02:00
parent 0692db1a90
commit a2374e65aa
13 changed files with 35 additions and 48 deletions

View file

@ -23,7 +23,7 @@ impl<'tcx> MirPass<'tcx> for SimplifyConstCondition {
TerminatorKind::SwitchInt {
discr: Operand::Constant(ref c), ref targets, ..
} => {
let constant = c.literal.try_eval_bits(tcx, param_env, c.ty());
let constant = c.literal.try_eval_bits(tcx, param_env);
if let Some(constant) = constant {
let target = targets.target_for_value(constant);
TerminatorKind::Goto { target }