Skip to content

Commit 623041e

Browse files
committed
Revise link_name text
1 parent 1fb40c0 commit 623041e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/items/external-blocks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,30 +395,30 @@ r[items.extern.attributes.link_name]
395395
### The `link_name` attribute
396396

397397
r[items.extern.attributes.link_name.intro]
398-
The *`link_name` [attribute][attributes]* may be specified on declarations inside an `extern` block to indicate the symbol to import for the given function or static.
398+
The *`link_name` [attribute][attributes]* may be applied to declarations inside an `extern` block to specify the symbol to import for the given function or static.
399399

400400
> [!EXAMPLE]
401401
> ```rust
402-
> unsafe extern {
402+
> unsafe extern "C" {
403403
> #[link_name = "actual_symbol_name"]
404404
> safe fn name_in_rust();
405405
> }
406406
> ```
407407
408408
r[items.extern.attributes.link_name.syntax]
409-
The `link_name` attribute uses the [MetaNameValueStr] syntax to specify the name of the symbol.
409+
The `link_name` attribute uses the [MetaNameValueStr] syntax.
410410
411411
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.
412+
The `link_name` attribute may only be applied to a function or static item in an `extern` block.
413413
414414
> [!NOTE]
415-
> `rustc` currently warns in other positions, but this may be rejected in the future.
415+
> `rustc` currently accepts and ignores the attribute in other positions but lints against it. This may become a hard error in the future.
416416
417417
r[items.extern.attributes.link_name.duplicates]
418418
Only the last instance of `link_name` on an item is used to determine the symbol name.
419419
420420
> [!NOTE]
421-
> `rustc` currently warns on preceding duplicate `link_name` attributes. This may become an error in the future.
421+
> `rustc` lints against duplicate use of this attribute on uses preceding the last. This may become a hard error in the future.
422422
423423
r[items.extern.attributes.link_name.link_ordinal]
424424
The `link_name` attribute may not be used with the [`link_ordinal`] attribute.

0 commit comments

Comments
 (0)