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

@ -699,7 +699,9 @@ impl<'tcx> Visitor<'tcx> for CanConstProp {
impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> {
fn visit_operand(&mut self, operand: &Operand<'tcx>, location: Location) {
self.super_operand(operand, location);
if let Some(place) = operand.place() && let Some(value) = self.replace_with_const(place) {
if let Some(place) = operand.place()
&& let Some(value) = self.replace_with_const(place)
{
self.patch.before_effect.insert((location, place), value);
}
}
@ -733,7 +735,10 @@ impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> {
if let Rvalue::Use(Operand::Constant(c)) = rvalue
&& let Const::Val(..) = c.const_
{
trace!("skipping replace of Rvalue::Use({:?} because it is already a const", c);
trace!(
"skipping replace of Rvalue::Use({:?} because it is already a const",
c
);
} else if let Some(operand) = self.replace_with_const(*place) {
self.patch.assignments.insert(location, operand);
}