diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-03-01 03:39:43 +0200 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-03-01 16:56:13 +0200 |
| commit | 2ecbc22856f7ac6acf2de9af65af7bbc81b35250 (patch) | |
| tree | b93979dc5ab2db82ed4df61883876a060246762d | |
| parent | 34ff9aa83fa014f77ffe8fa5a12268a033c95694 (diff) | |
| download | rust-2ecbc22856f7ac6acf2de9af65af7bbc81b35250.tar.gz rust-2ecbc22856f7ac6acf2de9af65af7bbc81b35250.zip | |
fix a few more typeck normalization cases
I'll like @nikomatsakis or someone to look at the unsolved variable case.
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index c3271914768..c42ef05bc5a 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -2092,10 +2092,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { Neither => { if let Some(default) = default_map.get(ty) { let default = default.clone(); + let default_ty = self.normalize_associated_types_in( + default.origin_span, &default.ty); match self.eq_types(false, &self.misc(default.origin_span), ty, - default.ty) { + default_ty) { Ok(ok) => self.register_infer_ok_obligations(ok), Err(_) => conflicts.push((*ty, default)), } @@ -4396,7 +4398,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } else if !infer_types && def.has_default { // No type parameter provided, but a default exists. let default = self.tcx.item_type(def.def_id); - default.subst_spanned(self.tcx, substs, Some(span)) + self.normalize_ty( + span, + default.subst_spanned(self.tcx, substs, Some(span)) + ) } else { // No type parameters were provided, we can infer all. // This can also be reached in some error cases: |
