Skip to content

Commit 5b2a760

Browse files
committed
Fix the error of checking base_expr twice in type_changing_struct_update
1 parent e95e084 commit 5b2a760

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_typeck/src/check

1 file changed

+1
-1
lines changed

compiler/rustc_typeck/src/check/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15081508
}
15091509
} else {
15101510
self.check_expr_has_type_or_error(base_expr, adt_ty, |_| {
1511-
let base_ty = self.check_expr(base_expr);
1511+
let base_ty = self.typeck_results.borrow().node_type(base_expr.hir_id);
15121512
let same_adt = match (adt_ty.kind(), base_ty.kind()) {
15131513
(ty::Adt(adt, _), ty::Adt(base_adt, _)) if adt == base_adt => true,
15141514
_ => false,

0 commit comments

Comments
 (0)