diff options
| author | Anne Stijns <anstijns@gmail.com> | 2025-06-29 15:37:54 +0200 |
|---|---|---|
| committer | Anne Stijns <anstijns@gmail.com> | 2025-06-29 16:23:46 +0200 |
| commit | 54cec0cf5a1f03e295f483d047a0feae203e715b (patch) | |
| tree | bc360096728d59285eb4e7eb99e67f578962dbb1 /src | |
| parent | 5ca574e85b67cec0a6fc3fddfe398cbe676c9c69 (diff) | |
| download | rust-54cec0cf5a1f03e295f483d047a0feae203e715b.tar.gz rust-54cec0cf5a1f03e295f483d047a0feae203e715b.zip | |
Port #[link_section] to the new attribute parsing infrastructure
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/types.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 3cac55493f0..600c564d714 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -753,9 +753,12 @@ impl Item { .other_attrs .iter() .filter_map(|attr| { + if let hir::Attribute::Parsed(AttributeKind::LinkSection { name, .. }) = attr { + Some(format!("#[link_section = \"{name}\"]")) + } // NoMangle is special cased, as it appears in HTML output, and we want to show it in source form, not HIR printing. // It is also used by cargo-semver-checks. - if let hir::Attribute::Parsed(AttributeKind::NoMangle(..)) = attr { + else if let hir::Attribute::Parsed(AttributeKind::NoMangle(..)) = attr { Some("#[no_mangle]".to_string()) } else if let hir::Attribute::Parsed(AttributeKind::ExportName { name, .. }) = attr { |
