]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/check/mod.rs
Auto merge of #88266 - nikomatsakis:issue-87879, r=jackh726
[rust.git] / compiler / rustc_typeck / src / check / mod.rs
index ad7e96e2833b84b65fb00e28fa918532d8740e43..a88b1c7af5a96640f49b498fd536d0524ea57834 100644 (file)
@@ -392,7 +392,7 @@ fn typeck_with_fallback<'tcx>(
                 fn_sig,
             );
 
-            let fcx = check_fn(&inh, param_env, fn_sig, decl, id, body, None).0;
+            let fcx = check_fn(&inh, param_env, fn_sig, decl, id, body, None, true).0;
             fcx
         } else {
             let fcx = FnCtxt::new(&inh, param_env, body.value.hir_id);
@@ -446,11 +446,12 @@ fn typeck_with_fallback<'tcx>(
             fcx
         };
 
-        fcx.type_inference_fallback();
+        let fallback_has_occurred = fcx.type_inference_fallback();
 
         // Even though coercion casts provide type hints, we check casts after fallback for
         // backwards compatibility. This makes fallback a stronger type hint than a cast coercion.
         fcx.check_casts();
+        fcx.select_obligations_where_possible(fallback_has_occurred, |_| {});
 
         // Closure and generator analysis may run after fallback
         // because they don't constrain other type variables.