X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_hir_typeck%2Fsrc%2Fexpr.rs;h=4a112e80f1d98f0ec775795fe304feb3c83c8e2d;hb=552b63c1619498f1a17fd482f4bb87815d8fdc48;hp=5166f1fd1c743fe74e0a0637c0c63beeded13243;hpb=e674b34d56b41657bddfcaa69fd224edd19f0b24;p=rust.git diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index 5166f1fd1c7..4a112e80f1d 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -528,6 +528,7 @@ pub(crate) fn check_expr_path( self.resolve_ty_and_res_fully_qualified_call(qpath, expr.hir_id, expr.span); let ty = match res { Res::Err => { + self.suggest_assoc_method_call(segs); let e = self.tcx.sess.delay_span_bug(qpath.span(), "`Res::Err` but no error emitted"); self.set_tainted_by_errors(e); @@ -1664,7 +1665,7 @@ fn check_expr_struct_fields( .fields .iter() .map(|f| { - let fru_ty = self.normalize_associated_types_in( + let fru_ty = self.normalize( expr_span, self.field_ty(base_expr.span, f, fresh_substs), ); @@ -1748,9 +1749,7 @@ fn check_expr_struct_fields( ty::Adt(adt, substs) if adt.is_struct() => variant .fields .iter() - .map(|f| { - self.normalize_associated_types_in(expr_span, f.ty(self.tcx, substs)) - }) + .map(|f| self.normalize(expr_span, f.ty(self.tcx, substs))) .collect(), _ => { self.tcx