Skip to content

Commit 39235be

Browse files
Add attributes to AttributeKind
1 parent 133798f commit 39235be

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
@@ -416,12 +416,24 @@ pub enum AttributeKind {
416416
/// Represents `#[pointee]`
417417
Pointee(Span),
418418

419+
/// Represents `#[proc_macro]`
420+
ProcMacro(Span),
421+
422+
/// Represents `#[proc_macro_attribute]`
423+
ProcMacroAttribute(Span),
424+
425+
/// Represents `#[proc_macro_derive]`
426+
ProcMacroDerive { trait_name: Symbol, helper_attrs: ThinVec<Symbol>, span: Span },
427+
419428
/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
420429
PubTransparent(Span),
421430

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

434+
/// Represents `#[rustc_builtin_macro]`.
435+
RustcBuiltinMacro { builtin_name: Option<Symbol>, helper_attrs: ThinVec<Symbol>, span: Span },
436+
425437
/// Represents `#[rustc_layout_scalar_valid_range_end]`.
426438
RustcLayoutScalarValidRangeEnd(Box<u128>, Span),
427439

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ impl AttributeKind {
6161
PassByValue(..) => Yes,
6262
Path(..) => No,
6363
Pointee(..) => No,
64+
ProcMacro(..) => No,
65+
ProcMacroAttribute(..) => No,
66+
ProcMacroDerive { .. } => No,
6467
PubTransparent(..) => Yes,
6568
Repr { .. } => No,
69+
RustcBuiltinMacro { .. } => Yes,
6670
RustcLayoutScalarValidRangeEnd(..) => Yes,
6771
RustcLayoutScalarValidRangeStart(..) => Yes,
6872
RustcObjectLifetimeDefault => No,

0 commit comments

Comments
 (0)