Skip to content

Commit 9dc78ac

Browse files
aidanhsManishearth
authored andcommitted
Note possiblities of empty extern blocks (based on rust-lang#12575)
1 parent 900b145 commit 9dc78ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

reference.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,10 @@ The type of a function declared in an extern block is `extern "abi" fn(A1, ...,
16361636
An) -> R`, where `A1...An` are the declared types of its arguments and `R` is
16371637
the declared return type.
16381638

1639+
It is valid to add the `link` attribute on an empty extern block. You can use
1640+
this to satisfy the linking requirements of extern blocks elsewhere in your code
1641+
(including upstream crates) instead of adding the attribute to each extern block.
1642+
16391643
## Visibility and Privacy
16401644

16411645
These two terms are often used interchangeably, and what they are attempting to

0 commit comments

Comments
 (0)