Skip to content

Commit 17825c9

Browse files
committed
review
1 parent 8752a56 commit 17825c9

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

compiler/rustc_middle/src/ty/structural_impls.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -333,16 +333,14 @@ CloneTypeFoldableAndLiftImpls! {
333333
impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>> Lift<'tcx> for (A, B) {
334334
type Lifted = (A::Lifted, B::Lifted);
335335
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
336-
let (a, b) = self;
337-
tcx.lift(a).and_then(|a| tcx.lift(b).map(|b| (a, b)))
336+
Some((tcx.lift(self.0)?, tcx.lift(self.1)?))
338337
}
339338
}
340339

341340
impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>, C: Lift<'tcx>> Lift<'tcx> for (A, B, C) {
342341
type Lifted = (A::Lifted, B::Lifted, C::Lifted);
343342
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
344-
let (a, b, c) = self;
345-
tcx.lift(a).and_then(|a| tcx.lift(b).and_then(|b| tcx.lift(c).map(|c| (a, b, c))))
343+
Some((tcx.lift(self.0)?, tcx.lift(self.1)?, tcx.lift(self.2)?))
346344
}
347345
}
348346

compiler/rustc_mir/src/borrow_check/mod.rs

+4-17
Original file line numberDiff line numberDiff line change
@@ -674,29 +674,16 @@ impl<'cx, 'tcx> dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tc
674674
TerminatorKind::SwitchInt { ref discr, switch_ty: _, targets: _ } => {
675675
self.consume_operand(loc, (discr, span), flow_state);
676676
}
677-
TerminatorKind::Drop { place: ref drop_place, target: _, unwind: _ } => {
678-
let tcx = self.infcx.tcx;
679-
680-
// Compute the type with accurate region information.
681-
let drop_place_ty = drop_place.ty(self.body, self.infcx.tcx);
682-
683-
// Erase the regions.
684-
let drop_place_ty = self.infcx.tcx.erase_regions(&drop_place_ty).ty;
685-
686-
// "Lift" into the tcx -- once regions are erased, this type should be in the
687-
// global arenas; this "lift" operation basically just asserts that is true, but
688-
// that is useful later.
689-
tcx.lift(drop_place_ty).unwrap();
690-
677+
TerminatorKind::Drop { place, target: _, unwind: _ } => {
691678
debug!(
692679
"visit_terminator_drop \
693-
loc: {:?} term: {:?} drop_place: {:?} drop_place_ty: {:?} span: {:?}",
694-
loc, term, drop_place, drop_place_ty, span
680+
loc: {:?} term: {:?} place: {:?} span: {:?}",
681+
loc, term, place, span
695682
);
696683

697684
self.access_place(
698685
loc,
699-
(*drop_place, span),
686+
(place, span),
700687
(AccessDepth::Drop, Write(WriteKind::StorageDeadOrDrop)),
701688
LocalMutationIsAllowed::Yes,
702689
flow_state,

0 commit comments

Comments
 (0)