Fix the error of checking base_expr
twice in type_changing_struct_update
This commit is contained in:
parent
e95e084a14
commit
5b2a7606ae
1 changed files with 1 additions and 1 deletions
|
@ -1508,7 +1508,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.check_expr_has_type_or_error(base_expr, adt_ty, |_| {
|
self.check_expr_has_type_or_error(base_expr, adt_ty, |_| {
|
||||||
let base_ty = self.check_expr(base_expr);
|
let base_ty = self.typeck_results.borrow().node_type(base_expr.hir_id);
|
||||||
let same_adt = match (adt_ty.kind(), base_ty.kind()) {
|
let same_adt = match (adt_ty.kind(), base_ty.kind()) {
|
||||||
(ty::Adt(adt, _), ty::Adt(base_adt, _)) if adt == base_adt => true,
|
(ty::Adt(adt, _), ty::Adt(base_adt, _)) if adt == base_adt => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue