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
|
@ -1696,7 +1696,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
// FIXME(@lcnr): Remove this function.
|
||||
pub fn get_attrs_unchecked(self, did: DefId) -> &'tcx [hir::Attribute] {
|
||||
if let Some(did) = did.as_local() {
|
||||
self.hir().attrs(self.local_def_id_to_hir_id(did))
|
||||
self.hir_attrs(self.local_def_id_to_hir_id(did))
|
||||
} else {
|
||||
self.attrs_for_def(did)
|
||||
}
|
||||
|
@ -1720,7 +1720,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
) -> impl Iterator<Item = &'tcx hir::Attribute> {
|
||||
let did: DefId = did.into();
|
||||
if let Some(did) = did.as_local() {
|
||||
self.hir().attrs(self.local_def_id_to_hir_id(did)).iter()
|
||||
self.hir_attrs(self.local_def_id_to_hir_id(did)).iter()
|
||||
} else {
|
||||
self.attrs_for_def(did).iter()
|
||||
}
|
||||
|
@ -1764,7 +1764,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
) -> impl Iterator<Item = &'tcx hir::Attribute> {
|
||||
let filter_fn = move |a: &&hir::Attribute| a.path_matches(attr);
|
||||
if let Some(did) = did.as_local() {
|
||||
self.hir().attrs(self.local_def_id_to_hir_id(did)).iter().filter(filter_fn)
|
||||
self.hir_attrs(self.local_def_id_to_hir_id(did)).iter().filter(filter_fn)
|
||||
} else {
|
||||
self.attrs_for_def(did).iter().filter(filter_fn)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue