Skip to content

Commit 558ae9e

Browse files
committed
fixup! clearer reasoning
1 parent f88c612 commit 558ae9e

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+4
-4
lines changed

compiler/rustc_mir_transform/src/gvn.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,10 +1410,10 @@ impl<'tcx> MutVisitor<'tcx> for VnState<'_, 'tcx> {
14101410
return;
14111411
}
14121412

1413-
let value = match lhs.as_local() {
1414-
Some(local) => self.locals[local],
1415-
None => self.simplify_rvalue(rvalue, location),
1416-
};
1413+
let value = lhs
1414+
.as_local()
1415+
.and_then(|local| self.locals[local])
1416+
.or_else(|| self.simplify_rvalue(rvalue, location));
14171417
debug!(?value);
14181418
let Some(value) = value else { return };
14191419

0 commit comments

Comments
 (0)