Skip to content

Commit 8f55815

Browse files
committed
Add attribute template rules for used
1 parent 2c0ea0b commit 8f55815

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/abi.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ The *`used` [attribute]* forces a [`static` item][items.static] to be kept in th
5858
> 0000000000000000 T foo::quux
5959
> ```
6060
61+
r[abi.used.syntax]
62+
The `used` attribute uses the [MetaWord] syntax and thus does not take any inputs.
63+
64+
r[abi.used.allowed-positions]
65+
The `used` attribute may only be applied to [`static` items][items.static].
66+
67+
r[abi.used.duplicates]
68+
Only the first instance of `used` on an item is honored. Subsequent `used` attributes are ignored.
69+
70+
> [!NOTE]
71+
> `rustc` currently warns on subsequent duplicate `used` attributes.
72+
6173
r[abi.no_mangle]
6274
## The `no_mangle` attribute
6375

0 commit comments

Comments
 (0)