Greatly simplify lifetime captures in edition 2024
This commit is contained in:
parent
46420c9607
commit
12e3911d81
84 changed files with 223 additions and 294 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue