1
Fork 0

lower attr spans and inline some functions to hopefully mitigate perf regressions

This commit is contained in:
Jana Dönszelmann 2025-02-24 14:07:34 +01:00
parent 2f0652745d
commit 4daa35ce33
No known key found for this signature in database
5 changed files with 52 additions and 13 deletions

View file

@ -870,7 +870,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
if attrs.is_empty() {
&[]
} else {
let lowered_attrs = self.lower_attrs_vec(attrs, target_span);
let lowered_attrs = self.lower_attrs_vec(attrs, self.lower_span(target_span));
debug_assert_eq!(id.owner, self.current_hir_id_owner);
let ret = self.arena.alloc_from_iter(lowered_attrs);
@ -891,7 +891,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}
fn lower_attrs_vec(&self, attrs: &[Attribute], target_span: Span) -> Vec<hir::Attribute> {
self.attribute_parser.parse_attribute_list(attrs, target_span, OmitDoc::Lower)
self.attribute_parser
.parse_attribute_list(attrs, target_span, OmitDoc::Lower, |s| self.lower_span(s))
}
fn alias_attrs(&mut self, id: HirId, target_id: HirId) {