Skip to content

Commit 2ca1fd8

Browse files
Add attributes to AttributeKind
1 parent 8df4a58 commit 2ca1fd8

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
@@ -301,12 +301,24 @@ pub enum AttributeKind {
301301
/// Represents `#[path]`
302302
Path(Symbol, Span),
303303

304+
/// Represents `#[proc_macro]`
305+
ProcMacro(Span),
306+
307+
/// Represents `#[proc_macro_attribute]`
308+
ProcMacroAttribute(Span),
309+
310+
/// Represents `#[proc_macro_derive]`
311+
ProcMacroDerive { trait_name: Symbol, helper_attrs: ThinVec<Symbol>, span: Span },
312+
304313
/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
305314
PubTransparent(Span),
306315

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

319+
/// Represents `#[rustc_builtin_macro]`.
320+
RustcBuiltinMacro { builtin_name: Option<Symbol>, helper_attrs: ThinVec<Symbol>, span: Span },
321+
310322
/// Represents `#[rustc_layout_scalar_valid_range_end]`.
311323
RustcLayoutScalarValidRangeEnd(Box<u128>, Span),
312324

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ impl AttributeKind {
4141
Optimize(..) => No,
4242
PassByValue(..) => Yes,
4343
Path(..) => No,
44+
ProcMacro(..) => No,
45+
ProcMacroAttribute(..) => No,
46+
ProcMacroDerive { .. } => No,
4447
PubTransparent(..) => Yes,
4548
Repr { .. } => No,
49+
RustcBuiltinMacro { .. } => Yes,
4650
RustcLayoutScalarValidRangeEnd(..) => Yes,
4751
RustcLayoutScalarValidRangeStart(..) => Yes,
4852
RustcObjectLifetimeDefault => No,

0 commit comments

Comments
 (0)