Skip to content

Commit 046165a

Browse files
committed
rename location field of Drop terminators to place
1 parent 302fb50 commit 046165a

File tree

25 files changed

+99
-111
lines changed

25 files changed

+99
-111
lines changed

src/librustc_codegen_ssa/mir/block.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,8 +998,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
998998
bx.unreachable();
999999
}
10001000

1001-
mir::TerminatorKind::Drop { location, target, unwind } => {
1002-
self.codegen_drop_terminator(helper, bx, location, target, unwind);
1001+
mir::TerminatorKind::Drop { place, target, unwind } => {
1002+
self.codegen_drop_terminator(helper, bx, place, target, unwind);
10031003
}
10041004

10051005
mir::TerminatorKind::Assert { ref cond, expected, ref msg, target, cleanup } => {

src/librustc_middle/mir/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ pub enum TerminatorKind<'tcx> {
11121112
Unreachable,
11131113

11141114
/// Drop the `Place`.
1115-
Drop { location: Place<'tcx>, target: BasicBlock, unwind: Option<BasicBlock> },
1115+
Drop { place: Place<'tcx>, target: BasicBlock, unwind: Option<BasicBlock> },
11161116

11171117
/// Drop the `Place` and assign the new value over it. This ensures
11181118
/// that the assignment to `P` occurs *even if* the destructor for
@@ -1141,7 +1141,7 @@ pub enum TerminatorKind<'tcx> {
11411141
/// }
11421142
/// ```
11431143
DropAndReplace {
1144-
location: Place<'tcx>,
1144+
place: Place<'tcx>,
11451145
value: Operand<'tcx>,
11461146
target: BasicBlock,
11471147
unwind: Option<BasicBlock>,
@@ -1607,9 +1607,9 @@ impl<'tcx> TerminatorKind<'tcx> {
16071607
Abort => write!(fmt, "abort"),
16081608
Yield { value, resume_arg, .. } => write!(fmt, "{:?} = yield({:?})", resume_arg, value),
16091609
Unreachable => write!(fmt, "unreachable"),
1610-
Drop { location, .. } => write!(fmt, "drop({:?})", location),
1611-
DropAndReplace { location, value, .. } => {
1612-
write!(fmt, "replace({:?} <- {:?})", location, value)
1610+
Drop { place, .. } => write!(fmt, "drop({:?})", place),
1611+
DropAndReplace { place, value, .. } => {
1612+
write!(fmt, "replace({:?} <- {:?})", place, value)
16131613
}
16141614
Call { func, args, destination, .. } => {
16151615
if let Some((destination, _)) = destination {

src/librustc_middle/mir/type_foldable.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
2727
values: values.clone(),
2828
targets: targets.clone(),
2929
},
30-
Drop { ref location, target, unwind } => {
31-
Drop { location: location.fold_with(folder), target, unwind }
30+
Drop { ref place, target, unwind } => {
31+
Drop { place: place.fold_with(folder), target, unwind }
3232
}
33-
DropAndReplace { ref location, ref value, target, unwind } => DropAndReplace {
34-
location: location.fold_with(folder),
33+
DropAndReplace { ref place, ref value, target, unwind } => DropAndReplace {
34+
place: place.fold_with(folder),
3535
value: value.fold_with(folder),
3636
target,
3737
unwind,
@@ -97,9 +97,9 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
9797
SwitchInt { ref discr, switch_ty, .. } => {
9898
discr.visit_with(visitor) || switch_ty.visit_with(visitor)
9999
}
100-
Drop { ref location, .. } => location.visit_with(visitor),
101-
DropAndReplace { ref location, ref value, .. } => {
102-
location.visit_with(visitor) || value.visit_with(visitor)
100+
Drop { ref place, .. } => place.visit_with(visitor),
101+
DropAndReplace { ref place, ref value, .. } => {
102+
place.visit_with(visitor) || value.visit_with(visitor)
103103
}
104104
Yield { ref value, .. } => value.visit_with(visitor),
105105
Call { ref func, ref args, ref destination, .. } => {

src/librustc_middle/mir/visit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,25 +449,25 @@ macro_rules! make_mir_visitor {
449449
}
450450

451451
TerminatorKind::Drop {
452-
location,
452+
place,
453453
target: _,
454454
unwind: _,
455455
} => {
456456
self.visit_place(
457-
location,
457+
place,
458458
PlaceContext::MutatingUse(MutatingUseContext::Drop),
459459
source_location
460460
);
461461
}
462462

463463
TerminatorKind::DropAndReplace {
464-
location,
464+
place,
465465
value,
466466
target: _,
467467
unwind: _,
468468
} => {
469469
self.visit_place(
470-
location,
470+
place,
471471
PlaceContext::MutatingUse(MutatingUseContext::Drop),
472472
source_location
473473
);

src/librustc_mir/borrow_check/invalidation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
119119
TerminatorKind::SwitchInt { ref discr, switch_ty: _, values: _, targets: _ } => {
120120
self.consume_operand(location, discr);
121121
}
122-
TerminatorKind::Drop { location: drop_place, target: _, unwind: _ } => {
122+
TerminatorKind::Drop { place: drop_place, target: _, unwind: _ } => {
123123
self.access_place(
124124
location,
125125
*drop_place,
@@ -128,7 +128,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
128128
);
129129
}
130130
TerminatorKind::DropAndReplace {
131-
location: drop_place,
131+
place: drop_place,
132132
value: ref new_value,
133133
target: _,
134134
unwind: _,

src/librustc_mir/borrow_check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ impl<'cx, 'tcx> dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tc
663663
TerminatorKind::SwitchInt { ref discr, switch_ty: _, values: _, targets: _ } => {
664664
self.consume_operand(loc, (discr, span), flow_state);
665665
}
666-
TerminatorKind::Drop { location: ref drop_place, target: _, unwind: _ } => {
666+
TerminatorKind::Drop { place: ref drop_place, target: _, unwind: _ } => {
667667
let tcx = self.infcx.tcx;
668668

669669
// Compute the type with accurate region information.
@@ -692,7 +692,7 @@ impl<'cx, 'tcx> dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tc
692692
);
693693
}
694694
TerminatorKind::DropAndReplace {
695-
location: drop_place,
695+
place: drop_place,
696696
value: ref new_value,
697697
target: _,
698698
unwind: _,

src/librustc_mir/borrow_check/type_check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,8 +1558,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
15581558
// no checks needed for these
15591559
}
15601560

1561-
TerminatorKind::DropAndReplace { ref location, ref value, target: _, unwind: _ } => {
1562-
let place_ty = location.ty(body, tcx).ty;
1561+
TerminatorKind::DropAndReplace { ref place, ref value, target: _, unwind: _ } => {
1562+
let place_ty = place.ty(body, tcx).ty;
15631563
let rv_ty = value.ty(body, tcx);
15641564

15651565
let locations = term_location.to_locations();

src/librustc_mir/borrow_check/used_muts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ impl<'visit, 'cx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'cx, 'tc
7070
TerminatorKind::Call { destination: Some((into, _)), .. } => {
7171
self.remove_never_initialized_mut_locals(*into);
7272
}
73-
TerminatorKind::DropAndReplace { location, .. } => {
74-
self.remove_never_initialized_mut_locals(*location);
73+
TerminatorKind::DropAndReplace { place, .. } => {
74+
self.remove_never_initialized_mut_locals(*place);
7575
}
7676
_ => {}
7777
}

src/librustc_mir/dataflow/framework/direction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ impl Direction for Forward {
441441
Goto { target } => propagate(target, exit_state),
442442

443443
Assert { target, cleanup: unwind, expected: _, msg: _, cond: _ }
444-
| Drop { target, unwind, location: _ }
445-
| DropAndReplace { target, unwind, value: _, location: _ }
444+
| Drop { target, unwind, place: _ }
445+
| DropAndReplace { target, unwind, value: _, place: _ }
446446
| FalseUnwind { real_target: target, unwind } => {
447447
if let Some(unwind) = unwind {
448448
if dead_unwinds.map_or(true, |dead| !dead.contains(bb)) {

src/librustc_mir/dataflow/impls/borrowed_locals.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ where
189189
self.super_terminator(terminator, location);
190190

191191
match terminator.kind {
192-
mir::TerminatorKind::Drop { location: dropped_place, .. }
193-
| mir::TerminatorKind::DropAndReplace { location: dropped_place, .. } => {
192+
mir::TerminatorKind::Drop { place: dropped_place, .. }
193+
| mir::TerminatorKind::DropAndReplace { place: dropped_place, .. } => {
194194
// See documentation for `unsound_ignore_borrow_on_drop` for an explanation.
195195
if !self.ignore_borrow_on_drop {
196196
self.trans.gen(dropped_place.local);

0 commit comments

Comments
 (0)