ty::KContainer -> ty::AssocItemContainer::K
This commit is contained in:
parent
8e6af16192
commit
be4b0261c2
21 changed files with 59 additions and 61 deletions
|
@ -1189,8 +1189,8 @@ fn compare_self_type<'tcx>(
|
|||
|
||||
let self_string = |method: ty::AssocItem| {
|
||||
let untransformed_self_ty = match method.container {
|
||||
ty::ImplContainer => impl_trait_ref.self_ty(),
|
||||
ty::TraitContainer => tcx.types.self_param,
|
||||
ty::AssocItemContainer::Impl => impl_trait_ref.self_ty(),
|
||||
ty::AssocItemContainer::Trait => tcx.types.self_param,
|
||||
};
|
||||
let self_arg_ty = tcx.fn_sig(method.def_id).instantiate_identity().input(0);
|
||||
let param_env = ty::ParamEnv::reveal_all();
|
||||
|
@ -2224,10 +2224,8 @@ fn param_env_with_gat_bounds<'tcx>(
|
|||
|
||||
for impl_ty in impl_tys_to_install {
|
||||
let trait_ty = match impl_ty.container {
|
||||
ty::AssocItemContainer::TraitContainer => impl_ty,
|
||||
ty::AssocItemContainer::ImplContainer => {
|
||||
tcx.associated_item(impl_ty.trait_item_def_id.unwrap())
|
||||
}
|
||||
ty::AssocItemContainer::Trait => impl_ty,
|
||||
ty::AssocItemContainer::Impl => tcx.associated_item(impl_ty.trait_item_def_id.unwrap()),
|
||||
};
|
||||
|
||||
let mut bound_vars: smallvec::SmallVec<[ty::BoundVariableKind; 8]> =
|
||||
|
|
|
@ -1048,8 +1048,10 @@ fn check_associated_item(
|
|||
.coherent_trait(tcx.parent(item.trait_item_def_id.unwrap_or(item_id.into())))?;
|
||||
|
||||
let self_ty = match item.container {
|
||||
ty::TraitContainer => tcx.types.self_param,
|
||||
ty::ImplContainer => tcx.type_of(item.container_id(tcx)).instantiate_identity(),
|
||||
ty::AssocItemContainer::Trait => tcx.types.self_param,
|
||||
ty::AssocItemContainer::Impl => {
|
||||
tcx.type_of(item.container_id(tcx)).instantiate_identity()
|
||||
}
|
||||
};
|
||||
|
||||
match item.kind {
|
||||
|
@ -1072,7 +1074,7 @@ fn check_associated_item(
|
|||
check_method_receiver(wfcx, hir_sig, item, self_ty)
|
||||
}
|
||||
ty::AssocKind::Type => {
|
||||
if let ty::AssocItemContainer::TraitContainer = item.container {
|
||||
if let ty::AssocItemContainer::Trait = item.container {
|
||||
check_associated_type_bounds(wfcx, item, span)
|
||||
}
|
||||
if item.defaultness(tcx).has_value() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue