diff options
| author | bors <bors@rust-lang.org> | 2024-07-01 08:51:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-01 08:51:46 +0000 |
| commit | c3774be7411722d3695de2ab1da9a358d0d5c82c (patch) | |
| tree | 2dc1c08faa0a7b26b122a740cf5f49496ea548fb /compiler/rustc_mir_transform/src | |
| parent | 7b21c18fe4de32a7d2faa468e6ef69abff013f85 (diff) | |
| parent | f5ef1cd17c0e4fb7aedafd4989938354e48cf0a7 (diff) | |
| download | rust-c3774be7411722d3695de2ab1da9a358d0d5c82c.tar.gz rust-c3774be7411722d3695de2ab1da9a358d0d5c82c.zip | |
Auto merge of #127197 - matthiaskrgr:rollup-aqpvn5q, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #126923 (test: dont optimize to invalid bitcasts) - #127090 (Reduce merge conflicts from rustfmt's wrapping) - #127105 (Only update `Eq` operands in GVN if it can update both sides) - #127150 (Fix x86_64 code being produced for bare-metal LoongArch targets' `compiler_builtins`) - #127181 (Introduce a `rustc_` attribute to dump all the `DefId` parents of a `DefId`) - #127182 (Fix error in documentation for IpAddr::to_canonical and Ipv6Addr::to_canonical) - #127191 (Ensure `out_of_scope_macro_calls` lint is registered) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/gvn.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index 936a7e2d9de..3dbdeb615cf 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -1074,11 +1074,11 @@ impl<'body, 'tcx> VnState<'body, 'tcx> { { lhs = *lhs_value; rhs = *rhs_value; - if let Some(op) = self.try_as_operand(lhs, location) { - *lhs_operand = op; - } - if let Some(op) = self.try_as_operand(rhs, location) { - *rhs_operand = op; + if let Some(lhs_op) = self.try_as_operand(lhs, location) + && let Some(rhs_op) = self.try_as_operand(rhs, location) + { + *lhs_operand = lhs_op; + *rhs_operand = rhs_op; } } |
