diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-05-31 17:05:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-31 17:05:25 +0200 |
| commit | 234ed6ae5ba581f35c2fb186fffd89b4f7f0138f (patch) | |
| tree | ee8ce3995257d73c06bc673c876f7f13f40cf048 /compiler/rustc_mir_transform/src | |
| parent | 5109a7668a1ae051e60144d737dfbbf4e14cd956 (diff) | |
| parent | 4b96e44ebbf42dc8b6f3e5ac4894739adc17d826 (diff) | |
| download | rust-234ed6ae5ba581f35c2fb186fffd89b4f7f0138f.tar.gz rust-234ed6ae5ba581f35c2fb186fffd89b4f7f0138f.zip | |
Rollup merge of #125796 - scottmcm:more-inst-simplify, r=oli-obk
Also InstSimplify `&raw*` We do this for `&*` and `&mut*` already; might as well do it for raw pointers too. r? mir-opt
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/instsimplify.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/instsimplify.rs b/compiler/rustc_mir_transform/src/instsimplify.rs index a54332b6f25..40db3e38fd3 100644 --- a/compiler/rustc_mir_transform/src/instsimplify.rs +++ b/compiler/rustc_mir_transform/src/instsimplify.rs @@ -123,7 +123,7 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> { /// Transform `&(*a)` ==> `a`. fn simplify_ref_deref(&self, source_info: &SourceInfo, rvalue: &mut Rvalue<'tcx>) { - if let Rvalue::Ref(_, _, place) = rvalue { + if let Rvalue::Ref(_, _, place) | Rvalue::AddressOf(_, place) = rvalue { if let Some((base, ProjectionElem::Deref)) = place.as_ref().last_projection() { if rvalue.ty(self.local_decls, self.tcx) != base.ty(self.local_decls, self.tcx).ty { return; |
