File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -406,10 +406,22 @@ The *`link_name` [attribute][attributes]* may be specified on declarations insid
406
406
> ```
407
407
408
408
r [items . extern . attributes. link_name. syntax]
409
- It uses the [MetaNameValueStr ] syntax to specify the name of the symbol .
409
+ The ` link_name ` attribute uses the [MetaNameValueStr ] syntax to specify the name of the symbol .
410
410
411
- r [items . extern . attributes. link_name. exclusive]
412
- Using this attribute with the `link_ordinal ` attribute will result in a compiler error .
411
+ r [items . extern . attributes. link_name. allowed- positions ]
412
+ The `link_name ` attribute may be specified on a function or static in an `extern ` block .
413
+
414
+ > [! NOTE ]
415
+ > `rustc ` currently warns in other positions , but this may be rejected in the future .
416
+
417
+ r [items . extern . attributes. link_name. duplicates]
418
+ Only the last instance of `link_name ` on an item is used to determine the symbol name .
419
+
420
+ > [! NOTE ]
421
+ > `rustc ` currently warns on preceding duplicate `link_name ` attributes . This may become an error in the future .
422
+
423
+ r [items . extern . attributes. link_name. link_ordinal]
424
+ The `link_name ` attribute may not be used with the [`link_ordinal `] attribute .
413
425
414
426
r [items . extern . attributes. link_ordinal]
415
427
### The `link_ordinal ` attribute
@@ -460,3 +472,4 @@ restrictions as [regular function parameters].
460
472
[ statics ] : static-items.md
461
473
[ unwind-behavior ] : functions.md#unwinding
462
474
[ value namespace ] : ../names/namespaces.md
475
+ [ `link_ordinal` ] : items.extern.attributes.link_ordinal
You can’t perform that action at this time.
0 commit comments