fix a few more typeck normalization cases
I'll like @nikomatsakis or someone to look at the unsolved variable case.
This commit is contained in:
@@ -2092,10 +2092,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||||||
Neither => {
|
Neither => {
|
||||||
if let Some(default) = default_map.get(ty) {
|
if let Some(default) = default_map.get(ty) {
|
||||||
let default = default.clone();
|
let default = default.clone();
|
||||||
|
let default_ty = self.normalize_associated_types_in(
|
||||||
|
default.origin_span, &default.ty);
|
||||||
match self.eq_types(false,
|
match self.eq_types(false,
|
||||||
&self.misc(default.origin_span),
|
&self.misc(default.origin_span),
|
||||||
ty,
|
ty,
|
||||||
default.ty) {
|
default_ty) {
|
||||||
Ok(ok) => self.register_infer_ok_obligations(ok),
|
Ok(ok) => self.register_infer_ok_obligations(ok),
|
||||||
Err(_) => conflicts.push((*ty, default)),
|
Err(_) => conflicts.push((*ty, default)),
|
||||||
}
|
}
|
||||||
@@ -4396,7 +4398,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||||||
} else if !infer_types && def.has_default {
|
} else if !infer_types && def.has_default {
|
||||||
// No type parameter provided, but a default exists.
|
// No type parameter provided, but a default exists.
|
||||||
let default = self.tcx.item_type(def.def_id);
|
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 {
|
} else {
|
||||||
// No type parameters were provided, we can infer all.
|
// No type parameters were provided, we can infer all.
|
||||||
// This can also be reached in some error cases:
|
// This can also be reached in some error cases:
|
||||||
|
|||||||
Reference in New Issue
Block a user