Skip to content

Commit a0a4611

Browse files
committed
Remove hir::Param::attrs.
1 parent 96788df commit a0a4611

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
663663
Ident::with_dummy_span(sym::_task_context),
664664
hir::BindingAnnotation::Mutable,
665665
);
666-
let param = hir::Param { attrs: &[], hir_id: self.next_id(), pat, ty_span: span, span };
666+
let param = hir::Param { hir_id: self.next_id(), pat, ty_span: span, span };
667667
let params = arena_vec![self; param];
668668

669669
let body_id = self.lower_body(move |this| {

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,9 +1042,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
10421042

10431043
fn lower_param(&mut self, param: &Param) -> hir::Param<'hir> {
10441044
let hir_id = self.lower_node_id(param.id);
1045+
self.lower_attrs(hir_id, &param.attrs);
10451046
hir::Param {
10461047
hir_id,
1047-
attrs: self.lower_attrs(hir_id, &param.attrs),
10481048
pat: self.lower_pat(&param.pat),
10491049
ty_span: param.ty.span,
10501050
span: param.span,
@@ -1179,7 +1179,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
11791179
let stmt_attrs = this.attrs[parameter.hir_id];
11801180
let (new_parameter_pat, new_parameter_id) = this.pat_ident(desugared_span, ident);
11811181
let new_parameter = hir::Param {
1182-
attrs: parameter.attrs,
11831182
hir_id: parameter.hir_id,
11841183
pat: new_parameter_pat,
11851184
ty_span: parameter.ty_span,

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2421,7 +2421,6 @@ pub struct LlvmInlineAsm<'hir> {
24212421
/// Represents a parameter in a function header.
24222422
#[derive(Debug, HashStable_Generic)]
24232423
pub struct Param<'hir> {
2424-
pub attrs: &'hir [Attribute],
24252424
pub hir_id: HirId,
24262425
pub pat: &'hir Pat<'hir>,
24272426
pub ty_span: Span,

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ impl<'a> State<'a> {
20322032
}
20332033

20342034
pub fn print_param(&mut self, arg: &hir::Param<'_>) {
2035-
self.print_outer_attributes(&arg.attrs);
2035+
self.print_outer_attributes(self.attrs(arg.hir_id));
20362036
self.print_pat(&arg.pat);
20372037
}
20382038

0 commit comments

Comments
 (0)