Skip to content

Commit 823c888

Browse files
committed
Try to resolve type vars in the placeholder errors trait refs
These can sometimes be unresolved: some of the rustc UI tests show this.
1 parent a602826 commit 823c888

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,18 @@ impl NiceRegionError<'me, 'gcx, 'tcx> {
224224
_ => (),
225225
}
226226

227-
let expected_trait_ref = ty::TraitRef {
228-
def_id: trait_def_id,
229-
substs: expected_substs,
230-
};
231-
let actual_trait_ref = ty::TraitRef {
232-
def_id: trait_def_id,
233-
substs: actual_substs,
234-
};
227+
let expected_trait_ref = self.infcx.resolve_type_vars_if_possible(
228+
&ty::TraitRef {
229+
def_id: trait_def_id,
230+
substs: expected_substs,
231+
}
232+
);
233+
let actual_trait_ref = self.infcx.resolve_type_vars_if_possible(
234+
&ty::TraitRef {
235+
def_id: trait_def_id,
236+
substs: actual_substs,
237+
}
238+
);
235239

236240
// Search the expected and actual trait references to see (a)
237241
// whether the sub/sup placeholders appear in them (sometimes

0 commit comments

Comments
 (0)