Skip to content

Commit f3f3e86

Browse files
committed
Note possiblities of empty extern blocks (based on rust-lang#12575)
1 parent 44e8243 commit f3f3e86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/doc/reference.md

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

1623+
It is valid to add the `link` attribute on an empty extern block. You can use
1624+
this to satisfy the linking requirements of extern blocks elsewhere in your code
1625+
(including upstream crates) instead of adding the attribute to each extern block.
1626+
16231627
## Visibility and Privacy
16241628

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

0 commit comments

Comments
 (0)