ty::KContainer -> ty::AssocItemContainer::K
This commit is contained in:
parent
8e6af16192
commit
be4b0261c2
21 changed files with 59 additions and 61 deletions
|
@ -10,8 +10,8 @@ use crate::ty;
|
|||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, HashStable, Hash, Encodable, Decodable)]
|
||||
pub enum AssocItemContainer {
|
||||
TraitContainer,
|
||||
ImplContainer,
|
||||
Trait,
|
||||
Impl,
|
||||
}
|
||||
|
||||
/// Information about an associated item
|
||||
|
@ -63,16 +63,16 @@ impl AssocItem {
|
|||
#[inline]
|
||||
pub fn trait_container(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
|
||||
match self.container {
|
||||
AssocItemContainer::ImplContainer => None,
|
||||
AssocItemContainer::TraitContainer => Some(tcx.parent(self.def_id)),
|
||||
AssocItemContainer::Impl => None,
|
||||
AssocItemContainer::Trait => Some(tcx.parent(self.def_id)),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn impl_container(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
|
||||
match self.container {
|
||||
AssocItemContainer::ImplContainer => Some(tcx.parent(self.def_id)),
|
||||
AssocItemContainer::TraitContainer => None,
|
||||
AssocItemContainer::Impl => Some(tcx.parent(self.def_id)),
|
||||
AssocItemContainer::Trait => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -690,7 +690,7 @@ impl<'tcx> Instance<'tcx> {
|
|||
&& !matches!(
|
||||
tcx.opt_associated_item(def),
|
||||
Some(ty::AssocItem {
|
||||
container: ty::AssocItemContainer::TraitContainer,
|
||||
container: ty::AssocItemContainer::Trait,
|
||||
..
|
||||
})
|
||||
)
|
||||
|
|
|
@ -55,9 +55,7 @@ use tracing::{debug, instrument};
|
|||
pub use vtable::*;
|
||||
use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir};
|
||||
|
||||
pub use self::AssocItemContainer::*;
|
||||
pub use self::BorrowKind::*;
|
||||
pub use self::IntVarValue::*;
|
||||
pub use self::closure::{
|
||||
BorrowKind, CAPTURE_STRUCT_LOCAL, CaptureInfo, CapturedPlace, ClosureTypeInfo,
|
||||
MinCaptureInformationMap, MinCaptureList, RootVariableMinCaptureList, UpvarCapture, UpvarId,
|
||||
|
@ -2074,7 +2072,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
let Some(item) = self.opt_associated_item(def_id) else {
|
||||
return false;
|
||||
};
|
||||
if item.container != ty::AssocItemContainer::ImplContainer {
|
||||
if item.container != ty::AssocItemContainer::Impl {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,8 +72,8 @@ pub fn call_kind<'tcx>(
|
|||
let parent = tcx.opt_associated_item(method_did).and_then(|assoc| {
|
||||
let container_id = assoc.container_id(tcx);
|
||||
match assoc.container {
|
||||
AssocItemContainer::ImplContainer => tcx.trait_id_of_impl(container_id),
|
||||
AssocItemContainer::TraitContainer => Some(container_id),
|
||||
AssocItemContainer::Impl => tcx.trait_id_of_impl(container_id),
|
||||
AssocItemContainer::Trait => Some(container_id),
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue