1
Fork 0

Greatly simplify lifetime captures in edition 2024

This commit is contained in:
Michael Goulet 2025-02-20 18:58:46 +00:00
parent 46420c9607
commit 12e3911d81
84 changed files with 223 additions and 294 deletions

View file

@ -1798,14 +1798,11 @@ impl<'tcx> TyCtxt<'tcx> {
}
}
pub fn get_attrs_by_path<'attr>(
pub fn get_attrs_by_path(
self,
did: DefId,
attr: &'attr [Symbol],
) -> impl Iterator<Item = &'tcx hir::Attribute> + 'attr
where
'tcx: 'attr,
{
attr: &[Symbol],
) -> 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)