Skip to content

Commit 1c1e795

Browse files
committed
remove is_replace field
1 parent 13fdf4c commit 1c1e795

File tree

16 files changed

+27
-97
lines changed

16 files changed

+27
-97
lines changed

compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
941941

942942
// drop and replace might have moved the assignment to the next block
943943
let maybe_additional_statement = if let Some(Terminator {
944-
kind: TerminatorKind::Drop { target: drop_target, is_replace: true, .. },
944+
kind: TerminatorKind::Drop { target: drop_target, .. },
945945
..
946946
}) = self.body[location.block].terminator
947947
{

compiler/rustc_borrowck/src/invalidation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
109109
TerminatorKind::SwitchInt { discr, targets: _ } => {
110110
self.consume_operand(location, discr);
111111
}
112-
TerminatorKind::Drop { place: drop_place, target: _, unwind: _, is_replace: _ } => {
112+
TerminatorKind::Drop { place: drop_place, target: _, unwind: _ } => {
113113
self.access_place(
114114
location,
115115
*drop_place,

compiler/rustc_borrowck/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
578578
StatementKind::Assign(box (lhs, rhs)) => {
579579
self.consume_rvalue(location, (rhs, span), flow_state);
580580

581-
self.mutate_place(location, (*lhs, span), AccessDepth::Shallow(None), flow_state);
581+
self.mutate_place(location, (*lhs, span), Shallow(None), flow_state);
582582
}
583583
StatementKind::FakeRead(box (_, place)) => {
584584
// Read for match doesn't access any memory and is used to
@@ -644,7 +644,7 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
644644
TerminatorKind::SwitchInt { discr, targets: _ } => {
645645
self.consume_operand(loc, (discr, span), flow_state);
646646
}
647-
TerminatorKind::Drop { place, target: _, unwind: _, is_replace: _ } => {
647+
TerminatorKind::Drop { place, target: _, unwind: _ } => {
648648
debug!(
649649
"visit_terminator_drop \
650650
loc: {:?} term: {:?} place: {:?} span: {:?}",

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
477477
| TerminatorKind::GeneratorDrop => {
478478
bug!("shouldn't exist at codegen {:?}", bb_data.terminator());
479479
}
480-
TerminatorKind::Drop { place, target, unwind: _, is_replace: _ } => {
480+
TerminatorKind::Drop { place, target, unwind: _ } => {
481481
let drop_place = codegen_place(fx, *place);
482482
crate::abi::codegen_drop(fx, source_info, drop_place);
483483

compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
13051305
MergingSucc::False
13061306
}
13071307

1308-
mir::TerminatorKind::Drop { place, target, unwind, is_replace: _ } => {
1308+
mir::TerminatorKind::Drop { place, target, unwind } => {
13091309
self.codegen_drop_terminator(helper, bx, place, target, unwind, mergeable_succ())
13101310
}
13111311

compiler/rustc_const_eval/src/interpret/terminator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
118118
}
119119
}
120120

121-
Drop { place, target, unwind, is_replace: _ } => {
121+
Drop { place, target, unwind } => {
122122
let frame = self.frame();
123123
let ty = place.ty(&frame.body.local_decls, *self.tcx).ty;
124124
let ty = self.subst_from_frame_and_normalize_erasing_regions(frame, ty)?;

compiler/rustc_middle/src/mir/syntax.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -577,14 +577,7 @@ pub enum TerminatorKind<'tcx> {
577577
/// > The drop glue is executed if, among all statements executed within this `Body`, an assignment to
578578
/// > the place or one of its "parents" occurred more recently than a move out of it. This does not
579579
/// > consider indirect assignments.
580-
Drop {
581-
place: Place<'tcx>,
582-
target: BasicBlock,
583-
unwind: Option<BasicBlock>,
584-
/// This field is only used for better diagnostic and to check MIR drop invariants.
585-
/// It has no effect on the semantics of the `Drop` terminator.
586-
is_replace: bool,
587-
},
580+
Drop { place: Place<'tcx>, target: BasicBlock, unwind: Option<BasicBlock> },
588581

589582
/// Roughly speaking, evaluates the `func` operand and the arguments, and starts execution of
590583
/// the referred to function. The operand types must match the argument types of the function.

compiler/rustc_middle/src/mir/visit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ macro_rules! make_mir_visitor {
486486
place,
487487
target: _,
488488
unwind: _,
489-
is_replace: _,
490489
} => {
491490
self.visit_place(
492491
place,

compiler/rustc_mir_build/src/build/custom/parse/instruction.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
4747
place: self.parse_place(args[0])?,
4848
target: self.parse_block(args[1])?,
4949
unwind: None,
50-
is_replace: false
5150
})
5251
},
5352
@call("mir_call", args) => {

compiler/rustc_mir_build/src/build/expr/as_rvalue.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,12 +624,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
624624
this.cfg.terminate(
625625
block,
626626
outer_source_info,
627-
TerminatorKind::Drop {
628-
place: to_drop,
629-
target: success,
630-
unwind: None,
631-
is_replace: false,
632-
},
627+
TerminatorKind::Drop { place: to_drop, target: success, unwind: None },
633628
);
634629
this.diverge_from(block);
635630
block = success;

0 commit comments

Comments
 (0)