diff options
| author | Predrag Gruevski <obi1kenobi82@gmail.com> | 2025-07-23 00:00:01 +0000 |
|---|---|---|
| committer | Predrag Gruevski <obi1kenobi82@gmail.com> | 2025-07-23 00:00:01 +0000 |
| commit | 45231fa599583edc95843aaa4f23b12f762e01e7 (patch) | |
| tree | 9e19d84d3e27be22aac1ae218602ec7daa890669 /tests/rustdoc/attributes-2021-edition.rs | |
| parent | a7a1618e6c835f1f00940ad72203d05808209a0d (diff) | |
| download | rust-45231fa599583edc95843aaa4f23b12f762e01e7.tar.gz rust-45231fa599583edc95843aaa4f23b12f762e01e7.zip | |
[rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.
Diffstat (limited to 'tests/rustdoc/attributes-2021-edition.rs')
| -rw-r--r-- | tests/rustdoc/attributes-2021-edition.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/rustdoc/attributes-2021-edition.rs b/tests/rustdoc/attributes-2021-edition.rs new file mode 100644 index 00000000000..b5028d8c852 --- /dev/null +++ b/tests/rustdoc/attributes-2021-edition.rs @@ -0,0 +1,14 @@ +//@ edition: 2021 +#![crate_name = "foo"] + +//@ has foo/fn.f.html '//pre[@class="rust item-decl"]' '#[unsafe(no_mangle)]' +#[no_mangle] +pub extern "C" fn f() {} + +//@ has foo/fn.g.html '//pre[@class="rust item-decl"]' '#[unsafe(export_name = "bar")]' +#[export_name = "bar"] +pub extern "C" fn g() {} + +//@ has foo/fn.example.html '//pre[@class="rust item-decl"]' '#[unsafe(link_section = ".text")]' +#[link_section = ".text"] +pub extern "C" fn example() {} |
