Skip to content

Commit 27abc17

Browse files
Add attributes to AttributeKind
1 parent d350797 commit 27abc17

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
@@ -313,12 +313,24 @@ pub enum AttributeKind {
313313
/// Represents `#[path]`
314314
Path(Symbol, Span),
315315

316+
/// Represents `#[proc_macro]`
317+
ProcMacro(Span),
318+
319+
/// Represents `#[proc_macro_attribute]`
320+
ProcMacroAttribute(Span),
321+
322+
/// Represents `#[proc_macro_derive]`
323+
ProcMacroDerive { trait_name: Symbol, helper_attrs: ThinVec<Symbol>, span: Span },
324+
316325
/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
317326
PubTransparent(Span),
318327

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

331+
/// Represents `#[rustc_builtin_macro]`.
332+
RustcBuiltinMacro { builtin_name: Option<Symbol>, helper_attrs: ThinVec<Symbol>, span: Span },
333+
322334
/// Represents `#[rustc_layout_scalar_valid_range_end]`.
323335
RustcLayoutScalarValidRangeEnd(Box<u128>, Span),
324336

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ impl AttributeKind {
4545
Optimize(..) => No,
4646
PassByValue(..) => Yes,
4747
Path(..) => No,
48+
ProcMacro(..) => No,
49+
ProcMacroAttribute(..) => No,
50+
ProcMacroDerive { .. } => No,
4851
PubTransparent(..) => Yes,
4952
Repr { .. } => No,
53+
RustcBuiltinMacro { .. } => Yes,
5054
RustcLayoutScalarValidRangeEnd(..) => Yes,
5155
RustcLayoutScalarValidRangeStart(..) => Yes,
5256
RustcObjectLifetimeDefault => No,

0 commit comments

Comments
 (0)