Skip to content

Commit

Permalink
fix a few more typeck normalization cases
Browse files Browse the repository at this point in the history
I'll like @nikomatsakis or someone to look at the unsolved variable
case.
  • Loading branch information
arielb1 committed Mar 1, 2017
1 parent 34ff9aa commit 2ecbc22
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2ecbc22

Please sign in to comment.