about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-22 19:16:17 +0000
committerbors <bors@rust-lang.org>2022-05-22 19:16:17 +0000
commitb2eed72a6fbf254e7d44942eaa121fcbed05d3fb (patch)
tree0a9da97c4c5fc3bb595d314ec921827e7c2302de
parent0a437b2ca081bc12425a3318cb66aade9824cbae (diff)
parent99603ef0742176b0ae7980146318469cf8d59cb2 (diff)
downloadrust-b2eed72a6fbf254e7d44942eaa121fcbed05d3fb.tar.gz
rust-b2eed72a6fbf254e7d44942eaa121fcbed05d3fb.zip
Auto merge of #97281 - est31:remove_box, r=compiler-errors
Remove box syntax from rustc_mir_dataflow and rustc_mir_transform

Continuation of #87781, inspired by #97239. The usages that this PR removes have not appeared from nothing, instead the usage in `rustc_mir_dataflow` and `rustc_mir_transform` was from #80522 which split up `rustc_mir`, and which was filed before I filed #87781, so it was using the state from before my PR. But it was merged after my PR was merged, so the `box_syntax` uses were able to survive here. Outside of this introduction due to the code being outside of the master branch at the point of merging of my PR, there was only one other introduction of box syntax, in #95159. That box syntax was removed again though in #95555. Outside of that, `box_syntax` has not made its reoccurrance in compiler crates.
-rw-r--r--compiler/rustc_mir_dataflow/src/lib.rs1
-rw-r--r--compiler/rustc_mir_transform/src/instcombine.rs4
-rw-r--r--compiler/rustc_mir_transform/src/lib.rs1
-rw-r--r--compiler/rustc_mir_transform/src/normalize_array_len.rs5
4 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs
index c1124a533bf..e4c130f0807 100644
--- a/compiler/rustc_mir_dataflow/src/lib.rs
+++ b/compiler/rustc_mir_dataflow/src/lib.rs
@@ -1,6 +1,5 @@
 #![feature(associated_type_defaults)]
 #![feature(box_patterns)]
-#![feature(box_syntax)]
 #![feature(exact_size_is_empty)]
 #![feature(let_else)]
 #![feature(min_specialization)]
diff --git a/compiler/rustc_mir_transform/src/instcombine.rs b/compiler/rustc_mir_transform/src/instcombine.rs
index d1c4a4b21d0..268ce1b2e8c 100644
--- a/compiler/rustc_mir_transform/src/instcombine.rs
+++ b/compiler/rustc_mir_transform/src/instcombine.rs
@@ -192,12 +192,12 @@ impl<'tcx> InstCombineContext<'tcx, '_> {
 
         statements.push(Statement {
             source_info: terminator.source_info,
-            kind: StatementKind::Assign(box (
+            kind: StatementKind::Assign(Box::new((
                 destination_place,
                 Rvalue::Use(Operand::Copy(
                     arg_place.project_deeper(&[ProjectionElem::Deref], self.tcx),
                 )),
-            )),
+            ))),
         });
         terminator.kind = TerminatorKind::Goto { target: destination_block };
     }
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs
index 1e8c373a411..571f541072a 100644
--- a/compiler/rustc_mir_transform/src/lib.rs
+++ b/compiler/rustc_mir_transform/src/lib.rs
@@ -1,6 +1,5 @@
 #![allow(rustc::potential_query_instability)]
 #![feature(box_patterns)]
-#![feature(box_syntax)]
 #![feature(let_chains)]
 #![feature(let_else)]
 #![feature(map_try_insert)]
diff --git a/compiler/rustc_mir_transform/src/normalize_array_len.rs b/compiler/rustc_mir_transform/src/normalize_array_len.rs
index cdfd49ef478..0f45711baa3 100644
--- a/compiler/rustc_mir_transform/src/normalize_array_len.rs
+++ b/compiler/rustc_mir_transform/src/normalize_array_len.rs
@@ -125,7 +125,7 @@ impl<'tcx> Patcher<'_, 'tcx> {
                             let assign_to = Place::from(local);
                             let rvalue = Rvalue::Use(operand);
                             make_copy_statement.kind =
-                                StatementKind::Assign(box (assign_to, rvalue));
+                                StatementKind::Assign(Box::new((assign_to, rvalue)));
                             statements.push(make_copy_statement);
 
                             // to reorder we have to copy and make NOP
@@ -165,7 +165,8 @@ impl<'tcx> Patcher<'_, 'tcx> {
                     if add_deref {
                         place = self.tcx.mk_place_deref(place);
                     }
-                    len_statement.kind = StatementKind::Assign(box (*into, Rvalue::Len(place)));
+                    len_statement.kind =
+                        StatementKind::Assign(Box::new((*into, Rvalue::Len(place))));
                     statements.push(len_statement);
 
                     // make temporary dead