1
Fork 0

Format all the let chains in compiler

This commit is contained in:
Michael Goulet 2023-10-13 08:58:33 +00:00
parent 2763ca50da
commit b2d2184ede
206 changed files with 3120 additions and 2228 deletions

View file

@ -627,9 +627,10 @@ impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> {
}
TerminatorKind::SwitchInt { ref discr, ref targets } => {
if let Some(ref value) = self.eval_operand(&discr, location)
&& let Some(value_const) = self.use_ecx(location, |this| this.ecx.read_scalar(value))
&& let Ok(constant) = value_const.try_to_int()
&& let Ok(constant) = constant.to_bits(constant.size())
&& let Some(value_const) =
self.use_ecx(location, |this| this.ecx.read_scalar(value))
&& let Ok(constant) = value_const.try_to_int()
&& let Ok(constant) = constant.to_bits(constant.size())
{
// We managed to evaluate the discriminant, so we know we only need to visit
// one target.