@@ -516,11 +516,29 @@ The *`link_ordinal` [attribute][attributes]* can be applied on declarations insi
516
516
> }
517
517
> ```
518
518
519
+ r [items . extern . attributes. link_ordinal. syntax]
520
+ The syntax for the `link_ordinal ` attribute is :
521
+
522
+ ```grammar ,attributes
523
+ @ root LinkOrdinalAttribute -> `link_ordinal ` `(` LinkOrdinal `)`
524
+
525
+ LinkOrdinal -> DEC_LITERAL | BIN_LITERAL | OCT_LITERAL | HEX_LITERAL
526
+ ```
527
+
528
+ r[ items.extern.attributes.link_ordinal.max]
529
+ The ordinal must be less than or equal to [ ` u16::MAX ` ] .
530
+
531
+ r[ items.extern.attributes.link_ordinal.allowed-positions]
532
+ The ` link_ordinal ` attribute may be specified on a function or static in an ` extern ` block.
533
+
534
+ r[ items.extern.attributes.link_ordinal.duplicates]
535
+ The ` link_ordinal ` attribute may only be specified once on an item.
536
+
519
537
r[ items.extern.attributes.link_ordinal.allowed-kinds]
520
- This attribute is only used with the `raw - dylib ` linking kind . Using any other kind will result in a compiler error .
538
+ The ` link_ordinal ` attribute may only be used with the [ ` raw-dylib ` linking kind] [ items.extern.attributes.link.raw-dylib ] .
521
539
522
- r [items . extern . attributes. link_ordinal. exclusive ]
523
- Using this attribute with the `link_name ` attribute will result in a compiler error .
540
+ r[ items.extern.attributes.link_ordinal.link_name ]
541
+ The ` link_ordinal ` attribute may not be used with the [ ` link_name ` ] attribute.
524
542
525
543
r[ items.extern.attributes.fn-parameters]
526
544
### Attributes on function parameters
@@ -535,6 +553,8 @@ restrictions as [regular function parameters].
535
553
[ `bundle` documentation for rustc ] : ../../rustc/command-line-arguments.html#linking-modifiers-bundle
536
554
[ `dylib` versus `raw-dylib` ] : #dylib-versus-raw-dylib
537
555
[ `extern fn` ] : items.fn.extern
556
+ [ `link_name` ] : items.extern.attributes.link_name
557
+ [ `link_ordinal` ] : items.extern.attributes.link_ordinal
538
558
[ `unsafe` context ] : ../unsafe-keyword.md
539
559
[ `verbatim` documentation for rustc ] : ../../rustc/command-line-arguments.html#linking-modifiers-verbatim
540
560
[ `whole-archive` documentation for rustc ] : ../../rustc/command-line-arguments.html#linking-modifiers-whole-archive
@@ -545,4 +565,3 @@ restrictions as [regular function parameters].
545
565
[ unwind-behavior ] : functions.md#unwinding
546
566
[ value namespace ] : ../names/namespaces.md
547
567
[ win32 api ] : https://learn.microsoft.com/en-us/windows/win32/api/
548
- [`link_ordinal `]: items . extern . attributes. link_ordinal
0 commit comments