Port #[export_name] to the new attribute parsing infrastructure

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This commit is contained in:
Jonathan Brouwer
2025-06-24 22:33:44 +02:00
parent bc4376fa73
commit 287d9afce7
13 changed files with 84 additions and 46 deletions

View File

@@ -231,6 +231,14 @@ pub enum AttributeKind {
/// Represents [`#[doc]`](https://doc.rust-lang.org/stable/rustdoc/write-documentation/the-doc-attribute.html).
DocComment { style: AttrStyle, kind: CommentKind, span: Span, comment: Symbol },
/// Represents [`#[export_name]`](https://doc.rust-lang.org/reference/abi.html#the-export_name-attribute).
ExportName {
/// The name to export this item with.
/// It may not contain \0 bytes as it will be converted to a null-terminated string.
name: Symbol,
span: Span,
},
/// Represents `#[inline]` and `#[rustc_force_inline]`.
Inline(InlineAttr, Span),

View File

@@ -22,6 +22,7 @@ impl AttributeKind {
ConstStabilityIndirect => No,
Deprecation { .. } => Yes,
DocComment { .. } => Yes,
ExportName { .. } => Yes,
Inline(..) => No,
MacroTransparency(..) => Yes,
Repr(..) => No,