Skip to content

Commit 83f6b91

Browse files
ehusstraviscross
authored andcommitted
Move example to intro and example block
1 parent 3401da6 commit 83f6b91

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/items/external-blocks.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -397,16 +397,17 @@ r[items.extern.attributes.link_name]
397397
r[items.extern.attributes.link_name.intro]
398398
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.
399399

400+
> [!EXAMPLE]
401+
> ```rust
402+
> unsafe extern {
403+
> #[link_name = "actual_symbol_name"]
404+
> safe fn name_in_rust();
405+
> }
406+
> ```
407+
400408
r[items.extern.attributes.link_name.syntax]
401409
It uses the [MetaNameValueStr] syntax to specify the name of the symbol.
402410
403-
```rust
404-
unsafe extern {
405-
#[link_name = "actual_symbol_name"]
406-
safe fn name_in_rust();
407-
}
408-
```
409-
410411
r[items.extern.attributes.link_name.exclusive]
411412
Using this attribute with the `link_ordinal` attribute will result in a compiler error.
412413

0 commit comments

Comments
 (0)