From e390acdfccdc5297e8fbb186bbb890cb6a3d0e57 Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Mon, 15 Jun 2020 15:59:51 +0100 Subject: [PATCH] Use expr_ty_adjusted in convert_place_op_to_mutable --- src/librustc_typeck/check/reconciliation.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/librustc_typeck/check/reconciliation.rs b/src/librustc_typeck/check/reconciliation.rs index b05155ae2aed..0a4293140a82 100644 --- a/src/librustc_typeck/check/reconciliation.rs +++ b/src/librustc_typeck/check/reconciliation.rs @@ -89,17 +89,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { return; } + // Need to deref because overloaded place ops take self by-reference. let base_ty = self .tables .borrow() - .expr_adjustments(base_expr) - .last() - .map_or_else(|| self.node_ty(expr.hir_id), |adj| adj.target); - let base_ty = self.resolve_vars_if_possible(&base_ty); - - // Need to deref because overloaded place ops take self by-reference. - let base_ty = - base_ty.builtin_deref(false).expect("place op takes something that is not a ref").ty; + .expr_ty_adjusted(base_expr) + .builtin_deref(false) + .expect("place op takes something that is not a ref") + .ty; let method = self.try_overloaded_place_op(expr.span, base_ty, arg_tys, Needs::MutPlace, op); let method = match method {