Skip to content

Commit b2eed72

Browse files
committed
Auto merge of rust-lang#97281 - est31:remove_box, r=compiler-errors
Remove box syntax from rustc_mir_dataflow and rustc_mir_transform Continuation of rust-lang#87781, inspired by rust-lang#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 rust-lang#80522 which split up `rustc_mir`, and which was filed before I filed rust-lang#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 rust-lang#95159. That box syntax was removed again though in rust-lang#95555. Outside of that, `box_syntax` has not made its reoccurrance in compiler crates.
2 parents 0a437b2 + 99603ef commit b2eed72

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

compiler/rustc_mir_dataflow/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(associated_type_defaults)]
22
#![feature(box_patterns)]
3-
#![feature(box_syntax)]
43
#![feature(exact_size_is_empty)]
54
#![feature(let_else)]
65
#![feature(min_specialization)]

compiler/rustc_mir_transform/src/instcombine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ impl<'tcx> InstCombineContext<'tcx, '_> {
192192

193193
statements.push(Statement {
194194
source_info: terminator.source_info,
195-
kind: StatementKind::Assign(box (
195+
kind: StatementKind::Assign(Box::new((
196196
destination_place,
197197
Rvalue::Use(Operand::Copy(
198198
arg_place.project_deeper(&[ProjectionElem::Deref], self.tcx),
199199
)),
200-
)),
200+
))),
201201
});
202202
terminator.kind = TerminatorKind::Goto { target: destination_block };
203203
}

compiler/rustc_mir_transform/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![allow(rustc::potential_query_instability)]
22
#![feature(box_patterns)]
3-
#![feature(box_syntax)]
43
#![feature(let_chains)]
54
#![feature(let_else)]
65
#![feature(map_try_insert)]

compiler/rustc_mir_transform/src/normalize_array_len.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<'tcx> Patcher<'_, 'tcx> {
125125
let assign_to = Place::from(local);
126126
let rvalue = Rvalue::Use(operand);
127127
make_copy_statement.kind =
128-
StatementKind::Assign(box (assign_to, rvalue));
128+
StatementKind::Assign(Box::new((assign_to, rvalue)));
129129
statements.push(make_copy_statement);
130130

131131
// to reorder we have to copy and make NOP
@@ -165,7 +165,8 @@ impl<'tcx> Patcher<'_, 'tcx> {
165165
if add_deref {
166166
place = self.tcx.mk_place_deref(place);
167167
}
168-
len_statement.kind = StatementKind::Assign(box (*into, Rvalue::Len(place)));
168+
len_statement.kind =
169+
StatementKind::Assign(Box::new((*into, Rvalue::Len(place))));
169170
statements.push(len_statement);
170171

171172
// make temporary dead

0 commit comments

Comments
 (0)