Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
resolve conflicts
  • Loading branch information
Rustin170506 committed Apr 5, 2021
1 parent 115e216 commit 6c3f5b8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 133 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/ty/assoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ty_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
125 changes: 0 additions & 125 deletions test.rs

This file was deleted.

0 comments on commit 6c3f5b8

Please sign in to comment.