Skip to content

Commit 8e8189f

Browse files
Add attributes to AttributeKind
1 parent a9fb610 commit 8e8189f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

compiler/rustc_attr_data_structures/src/attributes.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,24 @@ pub enum AttributeKind {
374374
/// Represents `#[path]`
375375
Path(Symbol, Span),
376376

377+
/// Represents `#[proc_macro]`
378+
ProcMacro(Span),
379+
380+
/// Represents `#[proc_macro_attribute]`
381+
ProcMacroAttribute(Span),
382+
383+
/// Represents `#[proc_macro_derive]`
384+
ProcMacroDerive { trait_name: Symbol, helper_attrs: ThinVec<Symbol>, span: Span },
385+
377386
/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
378387
PubTransparent(Span),
379388

380389
/// Represents [`#[repr]`](https://doc.rust-lang.org/stable/reference/type-layout.html#representations).
381390
Repr { reprs: ThinVec<(ReprAttr, Span)>, first_span: Span },
382391

392+
/// Represents `#[rustc_builtin_macro]`.
393+
RustcBuiltinMacro { builtin_name: Option<Symbol>, helper_attrs: ThinVec<Symbol>, span: Span },
394+
383395
/// Represents `#[rustc_layout_scalar_valid_range_end]`.
384396
RustcLayoutScalarValidRangeEnd(Box<u128>, Span),
385397

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ impl AttributeKind {
5757
ParenSugar(..) => No,
5858
PassByValue(..) => Yes,
5959
Path(..) => No,
60+
ProcMacro(..) => No,
61+
ProcMacroAttribute(..) => No,
62+
ProcMacroDerive { .. } => No,
6063
PubTransparent(..) => Yes,
6164
Repr { .. } => No,
65+
RustcBuiltinMacro { .. } => Yes,
6266
RustcLayoutScalarValidRangeEnd(..) => Yes,
6367
RustcLayoutScalarValidRangeStart(..) => Yes,
6468
RustcObjectLifetimeDefault => No,

0 commit comments

Comments
 (0)