change usages of type_of to bound_type_of
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ impl<'a, 'tcx> SolveContext<'a, 'tcx> {
|
||||
self.enforce_const_invariance(generics, variances);
|
||||
|
||||
// Functions are permitted to have unused generic parameters: make those invariant.
|
||||
if let ty::FnDef(..) = tcx.type_of(def_id).kind() {
|
||||
if let ty::FnDef(..) = tcx.bound_type_of(def_id).subst_identity().kind() {
|
||||
for variance in variances.iter_mut() {
|
||||
if *variance == ty::Bivariant {
|
||||
*variance = ty::Invariant;
|
||||
|
||||
Reference in New Issue
Block a user