Skip to content

Commit c8b31b3

Browse files
Structurallyresolve adts and tuples expectations too
1 parent a1eceec commit c8b31b3

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_hir_typeck/src

1 file changed

+2
-2
lines changed

compiler/rustc_hir_typeck/src/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17831783
expr: &'tcx hir::Expr<'tcx>,
17841784
) -> Ty<'tcx> {
17851785
let flds = expected.only_has_type(self).and_then(|ty| {
1786-
let ty = self.resolve_vars_with_obligations(ty);
1786+
let ty = self.try_structurally_resolve_type(expr.span, ty);
17871787
match ty.kind() {
17881788
ty::Tuple(flds) => Some(&flds[..]),
17891789
_ => None,
@@ -1861,7 +1861,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18611861
) {
18621862
let tcx = self.tcx;
18631863

1864-
let adt_ty = self.resolve_vars_with_obligations(adt_ty);
1864+
let adt_ty = self.try_structurally_resolve_type(span, adt_ty);
18651865
let adt_ty_hint = expected.only_has_type(self).and_then(|expected| {
18661866
self.fudge_inference_if_ok(|| {
18671867
let ocx = ObligationCtxt::new(self);

0 commit comments

Comments
 (0)