1
Fork 0

Make it clear that args default to being related invariantly

This commit is contained in:
Michael Goulet 2023-09-28 06:37:35 +00:00
parent cdef3b12de
commit be29d22eab
3 changed files with 12 additions and 12 deletions

View file

@ -56,7 +56,7 @@ impl<'tcx> TypeRelation<'tcx> for Equate<'_, '_, 'tcx> {
// performing trait matching (which then performs equality
// unification).
relate::relate_args(self, a_arg, b_arg)
relate::relate_args_invariantly(self, a_arg, b_arg)
}
fn relate_with_variance<T: Relate<'tcx>>(

View file

@ -183,7 +183,7 @@ where
// Avoid fetching the variance if we are in an invariant
// context; no need, and it can induce dependency cycles
// (e.g., #41849).
relate::relate_args(self, a_subst, b_subst)
relate::relate_args_invariantly(self, a_subst, b_subst)
} else {
let tcx = self.tcx();
let opt_variances = tcx.variances_of(item_def_id);