Skip to content

Commit 6c0c646

Browse files
committed
Minor update of no_mangle
More closely align with the template, and some minor word tweaks.
1 parent 123e6d4 commit 6c0c646

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/abi.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ $ nm -C foo.o
6161
0000000000000000 T foo::quux
6262
```
6363

64+
<!-- template:attributes -->
6465
r[abi.no_mangle]
6566
## The `no_mangle` attribute
6667

@@ -74,7 +75,7 @@ The *`no_mangle` attribute* may be used on functions and statics to disable stan
7475
> ```
7576
7677
r[abi.no_mangle.syntax]
77-
The `no_mangle` attribute uses the [MetaWord] syntax and thus does not take any inputs.
78+
The `no_mangle` attribute uses the [MetaWord] syntax.
7879
7980
r[abi.no_mangle.allowed-positions]
8081
The `no_mangle` attribute may only be applied to:
@@ -87,7 +88,7 @@ The `no_mangle` attribute may only be applied to:
8788
It may not be used with a [closure].
8889
8990
> [!NOTE]
90-
> `rustc` currently warns in other positions, but this may be rejected in the future.
91+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
9192
9293
<!-- TODO: Currently it works on a trait function with a body, but generates a warning about being phased out. how do we document that?
9394
https://github.com/rust-lang/rust/pull/86492#issuecomment-885682960
@@ -96,10 +97,10 @@ https://github.com/rust-lang/rust/pull/86492#issuecomment-885682960
9697
<!-- TODO: should this clarify that external block items are already unmangled?, and thus the attribute does nothing? Currently it is "phased out" warning. -->
9798
9899
r[abi.no_mangle.duplicates]
99-
Only the first instance of `no_mangle` on an item is honored. Subsequent `no_mangle` attributes are ignored.
100+
The `no_mangle` attribute may be used any number of times on a form.
100101
101102
> [!NOTE]
102-
> `rustc` currently warns on subsequent duplicate `no_mangle` attributes.
103+
> `rustc` lints against any use following the first.
103104
104105
r[abi.no_mangle.export_name]
105106
If `no_mangle` is used with [`export_name`][abi.export_name], then the `export_name` is used instead.

0 commit comments

Comments
 (0)