Skip to content

Commit 3ea8b10

Browse files
Add attributes to AttributeKind
1 parent e27f16a commit 3ea8b10

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
@@ -377,12 +377,24 @@ pub enum AttributeKind {
377377
/// Represents `#[pointee]`
378378
Pointee(Span),
379379

380+
/// Represents `#[proc_macro]`
381+
ProcMacro(Span),
382+
383+
/// Represents `#[proc_macro_attribute]`
384+
ProcMacroAttribute(Span),
385+
386+
/// Represents `#[proc_macro_derive]`
387+
ProcMacroDerive { trait_name: Symbol, helper_attrs: ThinVec<Symbol>, span: Span },
388+
380389
/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
381390
PubTransparent(Span),
382391

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

395+
/// Represents `#[rustc_builtin_macro]`.
396+
RustcBuiltinMacro { builtin_name: Option<Symbol>, helper_attrs: ThinVec<Symbol>, span: Span },
397+
386398
/// Represents `#[rustc_layout_scalar_valid_range_end]`.
387399
RustcLayoutScalarValidRangeEnd(Box<u128>, Span),
388400

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ impl AttributeKind {
5858
PassByValue(..) => Yes,
5959
Path(..) => No,
6060
Pointee(..) => No,
61+
ProcMacro(..) => No,
62+
ProcMacroAttribute(..) => No,
63+
ProcMacroDerive { .. } => No,
6164
PubTransparent(..) => Yes,
6265
Repr { .. } => No,
66+
RustcBuiltinMacro { .. } => Yes,
6367
RustcLayoutScalarValidRangeEnd(..) => Yes,
6468
RustcLayoutScalarValidRangeStart(..) => Yes,
6569
RustcObjectLifetimeDefault => No,

0 commit comments

Comments
 (0)