Try to resolve type vars in the placeholder errors trait refs

These can sometimes be unresolved: some of the rustc UI tests show this.
This commit is contained in:
lqd 2019-01-25 18:39:51 +01:00 committed by Rémy Rakic
parent a6028263d2
commit 823c888be2

View file

@ -224,14 +224,18 @@ impl NiceRegionError<'me, 'gcx, 'tcx> {
_ => (),
}
let expected_trait_ref = ty::TraitRef {
def_id: trait_def_id,
substs: expected_substs,
};
let actual_trait_ref = ty::TraitRef {
def_id: trait_def_id,
substs: actual_substs,
};
let expected_trait_ref = self.infcx.resolve_type_vars_if_possible(
&ty::TraitRef {
def_id: trait_def_id,
substs: expected_substs,
}
);
let actual_trait_ref = self.infcx.resolve_type_vars_if_possible(
&ty::TraitRef {
def_id: trait_def_id,
substs: actual_substs,
}
);
// Search the expected and actual trait references to see (a)
// whether the sub/sup placeholders appear in them (sometimes