Auto merge of #71511 - hi-rustin:rustin-patch-rename-assoc, r=eddyb,varkor
Rename AssociatedItems to AssocItems Signed-off-by: Rustin-Liu <rustin.liu@gmail.com> Part of https://github.com/rust-lang/rust/issues/60163#issuecomment-605308641
This commit is contained in:
commit
25c15cdbe0
@ -564,7 +564,7 @@ rustc_queries! {
|
||||
}
|
||||
|
||||
/// Collects the associated items defined on a trait or impl.
|
||||
query associated_items(key: DefId) -> ty::AssociatedItems<'tcx> {
|
||||
query associated_items(key: DefId) -> ty::AssocItems<'tcx> {
|
||||
storage(ArenaCacheSelector<'tcx>)
|
||||
desc { |tcx| "collecting associated items of {}", tcx.def_path_str(key) }
|
||||
}
|
||||
|
@ -96,15 +96,15 @@ impl AssocKind {
|
||||
/// it is relatively expensive. Instead, items are indexed by `Symbol` and hygienic comparison is
|
||||
/// done only on items with the same name.
|
||||
#[derive(Debug, Clone, PartialEq, HashStable)]
|
||||
pub struct AssociatedItems<'tcx> {
|
||||
pub struct AssocItems<'tcx> {
|
||||
pub(super) items: SortedIndexMultiMap<u32, Symbol, &'tcx ty::AssocItem>,
|
||||
}
|
||||
|
||||
impl<'tcx> AssociatedItems<'tcx> {
|
||||
impl<'tcx> AssocItems<'tcx> {
|
||||
/// Constructs an `AssociatedItems` map from a series of `ty::AssocItem`s in definition order.
|
||||
pub fn new(items_in_def_order: impl IntoIterator<Item = &'tcx ty::AssocItem>) -> Self {
|
||||
let items = items_in_def_order.into_iter().map(|item| (item.ident.name, item)).collect();
|
||||
AssociatedItems { items }
|
||||
AssocItems { items }
|
||||
}
|
||||
|
||||
/// Returns a slice of associated items in the order they were defined.
|
||||
|
@ -210,9 +210,9 @@ fn associated_item_def_ids(tcx: TyCtxt<'_>, def_id: DefId) -> &[DefId] {
|
||||
}
|
||||
}
|
||||
|
||||
fn associated_items(tcx: TyCtxt<'_>, def_id: DefId) -> ty::AssociatedItems<'_> {
|
||||
fn associated_items(tcx: TyCtxt<'_>, def_id: DefId) -> ty::AssocItems<'_> {
|
||||
let items = tcx.associated_item_def_ids(def_id).iter().map(|did| tcx.associated_item(*did));
|
||||
ty::AssociatedItems::new(items)
|
||||
ty::AssocItems::new(items)
|
||||
}
|
||||
|
||||
fn def_ident_span(tcx: TyCtxt<'_>, def_id: DefId) -> Option<Span> {
|
||||
|
@ -24,8 +24,8 @@ impl InherentOverlapChecker<'tcx> {
|
||||
/// namespace.
|
||||
fn impls_have_common_items(
|
||||
&self,
|
||||
impl_items1: &ty::AssociatedItems<'_>,
|
||||
impl_items2: &ty::AssociatedItems<'_>,
|
||||
impl_items1: &ty::AssocItems<'_>,
|
||||
impl_items2: &ty::AssocItems<'_>,
|
||||
) -> bool {
|
||||
let mut impl_items1 = &impl_items1;
|
||||
let mut impl_items2 = &impl_items2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user