Skip to content

Commit bca3f6c

Browse files
committed
Clarify usage of extern declarations from unsafe contex
1 parent 8cee694 commit bca3f6c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/items/external-blocks.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030
> &nbsp;&nbsp; ( _NamedFunctionParam_ `,` )<sup>\*</sup> _NamedFunctionParam_ `,` `...`
3131
3232
External blocks provide _declarations_ of items that are not _defined_ in the
33-
current crate and are the basis of Rust's foreign function interface. Using
34-
items declared in external blocks is only allowed in an `unsafe` context.
33+
current crate and are the basis of Rust's foreign function interface. These are
34+
sort of like unchecked imports.
3535

36-
Two kind of item _declarations_ are allowed in external blocks:
37-
[functions] and [statics].
36+
Two kind of item _declarations_ are allowed in external blocks: [functions] and
37+
[statics]. Calling functions or accessing statics that are declared in external
38+
blocks is only allowed in an `unsafe` context.
3839

3940
Functions within external blocks are declared in the same way as other Rust
4041
functions, with the exception that they may not have a body and are instead

0 commit comments

Comments
 (0)