about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-08-07 09:41:05 -0400
committerNiko Matsakis <niko@alum.mit.edu>2015-08-12 17:57:57 -0400
commit4561607403e1595d5ecbf36716711bc0076506f0 (patch)
treea386c92a717e2ba9162dbfcab7dc119ebf669d14 /src
parentd07d465cf60033e35eba16b9e431471d54c712f4 (diff)
downloadrust-4561607403e1595d5ecbf36716711bc0076506f0.tar.gz
rust-4561607403e1595d5ecbf36716711bc0076506f0.zip
Don't report a hard error if there are inference failures until
after we check casts, because sometimes casts can influence inference,
unfortunately. We do re-run `select_all_trait_obligations` during
regionck anyhow.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/check/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 6221134afd3..86d6d404fb0 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -445,9 +445,8 @@ fn check_bare_fn<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
 
             fcx.select_all_obligations_and_apply_defaults();
             upvar::closure_analyze_fn(&fcx, fn_id, decl, body);
-            fcx.select_all_obligations_or_error();
+            fcx.select_obligations_where_possible();
             fcx.check_casts();
-
             fcx.select_all_obligations_or_error(); // Casts can introduce new obligations.
 
             regionck::regionck_fn(&fcx, fn_id, fn_span, decl, body);