about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPredrag Gruevski <obi1kenobi82@gmail.com>2025-07-23 00:00:01 +0000
committerPredrag Gruevski <obi1kenobi82@gmail.com>2025-07-23 00:00:01 +0000
commit45231fa599583edc95843aaa4f23b12f762e01e7 (patch)
tree9e19d84d3e27be22aac1ae218602ec7daa890669 /src
parenta7a1618e6c835f1f00940ad72203d05808209a0d (diff)
downloadrust-45231fa599583edc95843aaa4f23b12f762e01e7.tar.gz
rust-45231fa599583edc95843aaa4f23b12f762e01e7.zip
[rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/clean/types.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index 5ac5da24299..64e707ad9d3 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -768,13 +768,13 @@ impl Item {
             .iter()
             .filter_map(|attr| match attr {
                 hir::Attribute::Parsed(AttributeKind::LinkSection { name, .. }) => {
-                    Some(format!("#[link_section = \"{name}\"]"))
+                    Some(format!("#[unsafe(link_section = \"{name}\")]"))
                 }
                 hir::Attribute::Parsed(AttributeKind::NoMangle(..)) => {
-                    Some("#[no_mangle]".to_string())
+                    Some("#[unsafe(no_mangle)]".to_string())
                 }
                 hir::Attribute::Parsed(AttributeKind::ExportName { name, .. }) => {
-                    Some(format!("#[export_name = \"{name}\"]"))
+                    Some(format!("#[unsafe(export_name = \"{name}\")]"))
                 }
                 hir::Attribute::Parsed(AttributeKind::NonExhaustive(..)) => {
                     Some("#[non_exhaustive]".to_string())