diff options
| author | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-06-24 22:33:44 +0200 |
|---|---|---|
| committer | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-06-26 08:50:42 +0200 |
| commit | 287d9afce729dd81fa9abfa860af31656d9c5e16 (patch) | |
| tree | 39bb92113ee1aab40e55fe7f6279f33b65f6db1e /compiler/rustc_attr_data_structures/src | |
| parent | bc4376fa73b636eb6f2c7d48b1f731d70f022c4b (diff) | |
Port `#[export_name]` to the new attribute parsing infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Diffstat (limited to 'compiler/rustc_attr_data_structures/src')
| -rw-r--r-- | compiler/rustc_attr_data_structures/src/attributes.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_attr_data_structures/src/encode_cross_crate.rs | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs index dc3598bcc36..d755afad59f 100644 --- a/compiler/rustc_attr_data_structures/src/attributes.rs +++ b/compiler/rustc_attr_data_structures/src/attributes.rs @@ -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), diff --git a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs index e41dd8bde8f..d4402f4e2e6 100644 --- a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs +++ b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs @@ -22,6 +22,7 @@ impl AttributeKind { ConstStabilityIndirect => No, Deprecation { .. } => Yes, DocComment { .. } => Yes, + ExportName { .. } => Yes, Inline(..) => No, MacroTransparency(..) => Yes, Repr(..) => No, |
