about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/clean/types.rs5
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
                 {