diff options
| author | Eric Mark Martin <ericmarkmartin@gmail.com> | 2023-06-25 20:38:01 -0400 |
|---|---|---|
| committer | Eric Mark Martin <ericmarkmartin@gmail.com> | 2023-06-25 20:38:01 -0400 |
| commit | c07c10d1e424d01e61c5900ec0700dd4c3caadb6 (patch) | |
| tree | 7b57baa9e2151db389cf81f49ed03065788e3990 /compiler/rustc_mir_transform/src/inline.rs | |
| parent | 0c2c243342ec2a2427f0624fac5ac59f0ee6fbcd (diff) | |
| download | rust-c07c10d1e424d01e61c5900ec0700dd4c3caadb6.tar.gz rust-c07c10d1e424d01e61c5900ec0700dd4c3caadb6.zip | |
use PlaceRef abstractions more consistently
Diffstat (limited to 'compiler/rustc_mir_transform/src/inline.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/inline.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index b28fed7159f..37c7a3b5880 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -839,15 +839,13 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> { /// to normalization failure. fn visit_projection_elem( &mut self, - local: Local, - proj_base: &[PlaceElem<'tcx>], + place_ref: PlaceRef<'tcx>, elem: PlaceElem<'tcx>, context: PlaceContext, location: Location, ) { if let ProjectionElem::Field(f, ty) = elem { - let parent = Place { local, projection: self.tcx.mk_place_elems(proj_base) }; - let parent_ty = parent.ty(&self.callee_body.local_decls, self.tcx); + let parent_ty = place_ref.ty(&self.callee_body.local_decls, self.tcx); let check_equal = |this: &mut Self, f_ty| { if !util::is_equal_up_to_subtyping(this.tcx, this.param_env, ty, f_ty) { trace!(?ty, ?f_ty); @@ -926,7 +924,7 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> { } } - self.super_projection_elem(local, proj_base, elem, context, location); + self.super_projection_elem(place_ref, elem, context, location); } } |
