1
Fork 0

change usages of type_of to bound_type_of

This commit is contained in:
Kyle Matsuda 2023-02-06 17:48:12 -07:00
parent 9a7cc6c32f
commit d822b97a27
136 changed files with 385 additions and 262 deletions

View file

@ -101,7 +101,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
let inferred_start = self.terms_cx.inferred_starts[&def_id];
let current_item = &CurrentItem { inferred_start };
match tcx.type_of(def_id).kind() {
match tcx.bound_type_of(def_id).subst_identity().kind() {
ty::Adt(def, _) => {
// Not entirely obvious: constraints on structs/enums do not
// affect the variance of their type parameters. See discussion
@ -112,7 +112,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
for field in def.all_fields() {
self.add_constraints_from_ty(
current_item,
tcx.type_of(field.did),
tcx.bound_type_of(field.did).subst_identity(),
self.covariant,
);
}