Rollup merge of #137504 - nnethercote:remove-Map-4, r=Zalathar
Move methods from Map to TyCtxt, part 4. A follow-up to https://github.com/rust-lang/rust/pull/137350. r? ```@Zalathar```
This commit is contained in:
commit
f88f27aff0
124 changed files with 390 additions and 441 deletions
|
@ -21,7 +21,7 @@ pub(crate) fn provide(providers: &mut Providers) {
|
|||
}
|
||||
|
||||
fn associated_item_def_ids(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &[DefId] {
|
||||
let item = tcx.hir().expect_item(def_id);
|
||||
let item = tcx.hir_expect_item(def_id);
|
||||
match item.kind {
|
||||
hir::ItemKind::Trait(.., trait_item_refs) => {
|
||||
// We collect RPITITs for each trait method's return type and create a
|
||||
|
@ -96,7 +96,7 @@ fn impl_item_implementor_ids(tcx: TyCtxt<'_>, impl_id: DefId) -> DefIdMap<DefId>
|
|||
fn associated_item(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::AssocItem {
|
||||
let id = tcx.local_def_id_to_hir_id(def_id);
|
||||
let parent_def_id = tcx.hir_get_parent_item(id);
|
||||
let parent_item = tcx.hir().expect_item(parent_def_id.def_id);
|
||||
let parent_item = tcx.hir_expect_item(parent_def_id.def_id);
|
||||
match parent_item.kind {
|
||||
hir::ItemKind::Impl(impl_) => {
|
||||
if let Some(impl_item_ref) = impl_.items.iter().find(|i| i.id.owner_id.def_id == def_id)
|
||||
|
@ -201,7 +201,7 @@ fn associated_types_for_impl_traits_in_associated_fn(
|
|||
|
||||
let mut visitor = RPITVisitor { rpits: FxIndexSet::default() };
|
||||
|
||||
if let Some(output) = tcx.hir().get_fn_output(fn_def_id) {
|
||||
if let Some(output) = tcx.hir_get_fn_output(fn_def_id) {
|
||||
visitor.visit_fn_ret_ty(output);
|
||||
|
||||
tcx.arena.alloc_from_iter(visitor.rpits.iter().map(|opaque_ty_def_id| {
|
||||
|
|
|
@ -161,7 +161,7 @@ fn fn_sig_spans(tcx: TyCtxt<'_>, def_id: LocalDefId) -> impl Iterator<Item = Spa
|
|||
}
|
||||
|
||||
fn impl_spans(tcx: TyCtxt<'_>, def_id: LocalDefId) -> impl Iterator<Item = Span> {
|
||||
let item = tcx.hir().expect_item(def_id);
|
||||
let item = tcx.hir_expect_item(def_id);
|
||||
if let hir::ItemKind::Impl(impl_) = item.kind {
|
||||
let trait_args = impl_
|
||||
.of_trait
|
||||
|
|
|
@ -187,7 +187,7 @@ impl<'tcx> OpaqueTypeCollector<'tcx> {
|
|||
if !hir_id.is_owner() {
|
||||
return;
|
||||
}
|
||||
let Some(defines) = self.tcx.hir_attrs(hir_id.owner).define_opaque else {
|
||||
let Some(defines) = self.tcx.hir_attr_map(hir_id.owner).define_opaque else {
|
||||
return;
|
||||
};
|
||||
for &(span, define) in defines {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue