Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Add workaround for index out of bounds on escaping substs #312

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/mismatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
None
}
(&TyKind::FnDef(a_def_id, a_substs), &TyKind::FnDef(b_def_id, b_substs)) => {
if self.check_substs(a_substs, b_substs) {
// NEEDSWORK: the second half of this check is more of a workaround; see #188
if self.check_substs(a_substs, b_substs) && !self.tcx.variances_of(a_def_id).is_empty() {
let a_sig = a.fn_sig(self.tcx);
let b_sig = b.fn_sig(self.tcx);
let _ = self.relate_item_substs(a_def_id, a_substs, b_substs)?;
Expand Down