Skip to content

Commit d64f8fc

Browse files
Add attributes to AttributeKind
1 parent 7f2065a commit d64f8fc

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
@@ -349,12 +349,24 @@ pub enum AttributeKind {
349349
/// Represents `#[path]`
350350
Path(Symbol, Span),
351351

352+
/// Represents `#[proc_macro]`
353+
ProcMacro(Span),
354+
355+
/// Represents `#[proc_macro_attribute]`
356+
ProcMacroAttribute(Span),
357+
358+
/// Represents `#[proc_macro_derive]`
359+
ProcMacroDerive { trait_name: Symbol, helper_attrs: ThinVec<Symbol>, span: Span },
360+
352361
/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
353362
PubTransparent(Span),
354363

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

367+
/// Represents `#[rustc_builtin_macro]`.
368+
RustcBuiltinMacro { builtin_name: Option<Symbol>, helper_attrs: ThinVec<Symbol>, span: Span },
369+
358370
/// Represents `#[rustc_layout_scalar_valid_range_end]`.
359371
RustcLayoutScalarValidRangeEnd(Box<u128>, Span),
360372

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)