about summary refs log tree commit diff
path: root/tests/rustdoc/attributes.rs
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 /tests/rustdoc/attributes.rs
parenta7a1618e6c835f1f00940ad72203d05808209a0d (diff)
downloadrust-45231fa599583edc95843aaa4f23b12f762e01e7.tar.gz
rust-45231fa599583edc95843aaa4f23b12f762e01e7.zip
[rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.
Diffstat (limited to 'tests/rustdoc/attributes.rs')
-rw-r--r--tests/rustdoc/attributes.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/rustdoc/attributes.rs b/tests/rustdoc/attributes.rs
index e34468a88b1..34487a89127 100644
--- a/tests/rustdoc/attributes.rs
+++ b/tests/rustdoc/attributes.rs
@@ -1,13 +1,18 @@
+//@ edition: 2024
 #![crate_name = "foo"]
 
-//@ has foo/fn.f.html '//pre[@class="rust item-decl"]' '#[no_mangle]'
-#[no_mangle]
+//@ has foo/fn.f.html '//pre[@class="rust item-decl"]' '#[unsafe(no_mangle)]'
+#[unsafe(no_mangle)]
 pub extern "C" fn f() {}
 
-//@ has foo/fn.g.html '//pre[@class="rust item-decl"]' '#[export_name = "bar"]'
-#[export_name = "bar"]
+//@ has foo/fn.g.html '//pre[@class="rust item-decl"]' '#[unsafe(export_name = "bar")]'
+#[unsafe(export_name = "bar")]
 pub extern "C" fn g() {}
 
+//@ has foo/fn.example.html '//pre[@class="rust item-decl"]' '#[unsafe(link_section = ".text")]'
+#[unsafe(link_section = ".text")]
+pub extern "C" fn example() {}
+
 //@ has foo/struct.Repr.html '//pre[@class="rust item-decl"]' '#[repr(C, align(8))]'
 #[repr(C, align(8))]
 pub struct Repr;