Skip to content

Commit bbc6785

Browse files
committed
Update edition differences for unsafe extern blocks
This follows the style that the main text should describe the current edition, and that edition differences are in a blockquote, and they describe what is different.
1 parent 64fb10c commit bbc6785

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/items/external-blocks.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ Calling functions or accessing statics that are declared in external blocks is o
3333
r[items.extern.namespace]
3434
The external block defines its functions and statics in the [value namespace] of the module or block where it is located.
3535

36-
**Edition differences**: Starting in the 2024 edition, the `unsafe` keyword is
37-
required to appear before the `extern` keyword on external blocks. In previous
38-
editions, it is accepted but not required. The `safe` and `unsafe` item qualifiers
39-
are only allowed if the external block itself is marked as `unsafe`.
36+
r[items.extern.unsafe-required]
37+
The `unsafe` keyword is semantically required to appear before the `extern` keyword on external blocks.
38+
39+
r[items.extern.edition2024]
40+
> **Edition differences**: Prior to the 2024 edition, the `unsafe` keyword is optional. The `safe` and `unsafe` item qualifiers are only allowed if the external block itself is marked as `unsafe`.
4041
4142
## Functions
4243

src/unsafe-keyword.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ r[unsafe.extern]
8181

8282
The programmer who declares an [external block] must assure that the signatures of the items contained within are correct. Failing to do so may lead to undefined behavior. That this obligation has been met is indicated by writing `unsafe extern`.
8383

84-
**Edition differences**: Prior to edition 2024, `extern` blocks were allowed without being qualified as `unsafe`.
84+
r[unsafe.extern.edition2024]
85+
> **Edition differences**: Prior to edition 2024, `extern` blocks were allowed without being qualified as `unsafe`.
8586
8687
[external block]: items/external-blocks.md
8788

0 commit comments

Comments
 (0)