diff options
| author | Alona Enraght-Moony <code@alona.page> | 2025-07-30 19:57:32 +0000 |
|---|---|---|
| committer | Alona Enraght-Moony <code@alona.page> | 2025-07-30 19:57:32 +0000 |
| commit | a33e084afe698e0a025211abd6dc1c9a4bb22e9d (patch) | |
| tree | fc39d672426c2ec67b5acc689a6d2285f7047207 /src | |
| parent | 1a515e69490cdc3cee5325c4fc8d18baa502f38a (diff) | |
| download | rust-a33e084afe698e0a025211abd6dc1c9a4bb22e9d.tar.gz rust-a33e084afe698e0a025211abd6dc1c9a4bb22e9d.zip | |
rustdoc-json: Move `#[macro_export]` from `Other` to it's own variant
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/json/conversions.rs | 8 | ||||
| -rw-r--r-- | src/rustdoc-json-types/lib.rs | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index 08bc0bb1950..fe69a5abee1 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -908,8 +908,12 @@ fn maybe_from_hir_attr( hir::Attribute::Parsed(kind) => kind, hir::Attribute::Unparsed(_) => { - // FIXME: We should handle `#[doc(hidden)]`. - return Some(other_attr(tcx, attr)); + return Some(if attr.has_name(sym::macro_export) { + Attribute::MacroExport + // FIXME: We should handle `#[doc(hidden)]`. + } else { + other_attr(tcx, attr) + }); } }; diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 6235b0e8576..40f89009a43 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -37,8 +37,8 @@ pub type FxHashMap<K, V> = HashMap<K, V>; // re-export for use in src/librustdoc // will instead cause conflicts. See #94591 for more. (This paragraph and the "Latest feature" line // are deliberately not in a doc comment, because they need not be in public docs.) // -// Latest feature: Structured Attributes -pub const FORMAT_VERSION: u32 = 54; +// Latest feature: Add Attribute::MacroUse +pub const FORMAT_VERSION: u32 = 55; /// The root of the emitted JSON blob. /// @@ -216,6 +216,9 @@ pub enum Attribute { /// `#[must_use]` MustUse { reason: Option<String> }, + /// `#[macro_export]` + MacroExport, + /// `#[export_name = "name"]` ExportName(String), |
