about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-06-24 14:53:59 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-07-15 15:56:16 +0000
commit7a8a048b5853c6e44af53d924a7c0feb2140e5af (patch)
treea217efd8fa4cf9f736ad582b806186670d7a98ad
parenteeb10335ce94d35f3c13f7d14fabc91b3dcd469c (diff)
downloadrust-7a8a048b5853c6e44af53d924a7c0feb2140e5af.tar.gz
rust-7a8a048b5853c6e44af53d924a7c0feb2140e5af.zip
Remove early return that would likely have caused miscompilations if it ever happened
-rw-r--r--compiler/rustc_mir_build/src/build/matches/test.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/compiler/rustc_mir_build/src/build/matches/test.rs b/compiler/rustc_mir_build/src/build/matches/test.rs
index 92f00560f01..4e2a137c3fc 100644
--- a/compiler/rustc_mir_build/src/build/matches/test.rs
+++ b/compiler/rustc_mir_build/src/build/matches/test.rs
@@ -154,19 +154,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
         test: &Test<'tcx>,
         make_target_blocks: impl FnOnce(&mut Self) -> Vec<BasicBlock>,
     ) {
-        let place: Place<'tcx>;
-        if let Ok(test_place_builder) = place_builder.try_upvars_resolved(self) {
-            place = test_place_builder.into_place(self);
-        } else {
-            return;
-        }
-        debug!(
-            "perform_test({:?}, {:?}: {:?}, {:?})",
-            block,
-            place,
-            place.ty(&self.local_decls, self.tcx),
-            test
-        );
+        let place = place_builder.into_place(self);
+        let place_ty = place.ty(&self.local_decls, self.tcx);
+        debug!(?place, ?place_ty,);
 
         let source_info = self.source_info(test.span);
         match test.kind {