Skip to content

Commit 2ecbc22

Browse files
committed
fix a few more typeck normalization cases
I'll like @nikomatsakis or someone to look at the unsolved variable case.
1 parent 34ff9aa commit 2ecbc22

File tree

1 file changed

+7
-2
lines changed
  • src/librustc_typeck/check

1 file changed

+7
-2
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,10 +2092,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
20922092
Neither => {
20932093
if let Some(default) = default_map.get(ty) {
20942094
let default = default.clone();
2095+
let default_ty = self.normalize_associated_types_in(
2096+
default.origin_span, &default.ty);
20952097
match self.eq_types(false,
20962098
&self.misc(default.origin_span),
20972099
ty,
2098-
default.ty) {
2100+
default_ty) {
20992101
Ok(ok) => self.register_infer_ok_obligations(ok),
21002102
Err(_) => conflicts.push((*ty, default)),
21012103
}
@@ -4396,7 +4398,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
43964398
} else if !infer_types && def.has_default {
43974399
// No type parameter provided, but a default exists.
43984400
let default = self.tcx.item_type(def.def_id);
4399-
default.subst_spanned(self.tcx, substs, Some(span))
4401+
self.normalize_ty(
4402+
span,
4403+
default.subst_spanned(self.tcx, substs, Some(span))
4404+
)
44004405
} else {
44014406
// No type parameters were provided, we can infer all.
44024407
// This can also be reached in some error cases:

0 commit comments

Comments
 (0)