Skip to content

Commit 875b905

Browse files
committed
Remove 2024 unsafe extern block notes
These will be added back when 2024 stabilizes.
1 parent a1a6f29 commit 875b905

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

src/items/external-blocks.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> **<sup>Syntax</sup>**\
44
> _ExternBlock_ :\
5-
> &nbsp;&nbsp; `unsafe`<sup>?</sup>[^unsafe-2024] `extern` [_Abi_]<sup>?</sup> `{`\
5+
> &nbsp;&nbsp; `unsafe`<sup>?</sup> `extern` [_Abi_]<sup>?</sup> `{`\
66
> &nbsp;&nbsp; &nbsp;&nbsp; [_InnerAttribute_]<sup>\*</sup>\
77
> &nbsp;&nbsp; &nbsp;&nbsp; _ExternalItem_<sup>\*</sup>\
88
> &nbsp;&nbsp; `}`
@@ -12,8 +12,6 @@
1212
> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [_MacroInvocationSemi_]\
1313
> &nbsp;&nbsp; &nbsp;&nbsp; | ( [_Visibility_]<sup>?</sup> ( [_StaticItem_] | [_Function_] ) )\
1414
> &nbsp;&nbsp; )
15-
>
16-
> [^unsafe-2024]: Starting with the 2024 Edition, the `unsafe` keyword is required semantically.
1715
1816
External blocks provide _declarations_ of items that are not _defined_ in the
1917
current crate and are the basis of Rust's foreign function interface. These are
@@ -25,11 +23,6 @@ blocks is only allowed in an `unsafe` context.
2523

2624
The external block defines its functions and statics in the [value namespace] of the module or block where it is located.
2725

28-
**Edition differences**: Starting in the 2024 edition, the `unsafe` keyword is
29-
required to appear before the `extern` keyword on external blocks. In previous
30-
editions, it is accepted but not required. The `safe` and `unsafe` item qualifiers
31-
are only allowed if the external block itself is marked as `unsafe`.
32-
3326
## Functions
3427

3528
Functions within external blocks are declared in the same way as other Rust

src/items/functions.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
> &nbsp;&nbsp; &nbsp;&nbsp; ( [_BlockExpression_] | `;` )
99
>
1010
> _FunctionQualifiers_ :\
11-
> &nbsp;&nbsp; `const`<sup>?</sup> `async`[^async-edition]<sup>?</sup> _ItemSafety_<sup>?</sup>[^extern-qualifiers] (`extern` _Abi_<sup>?</sup>)<sup>?</sup>
11+
> &nbsp;&nbsp; `const`<sup>?</sup> `async`[^async-edition]<sup>?</sup> _ItemSafety_<sup>?</sup> (`extern` _Abi_<sup>?</sup>)<sup>?</sup>
1212
>
1313
> _ItemSafety_ :\
1414
> &nbsp;&nbsp; `safe`[^extern-safe] | `unsafe`
@@ -45,10 +45,6 @@
4545
> [^extern-safe]: The `safe` function qualifier is only allowed semantically within
4646
> `extern` blocks.
4747
>
48-
> [^extern-qualifiers]: *Relevant to editions earlier than Rust 2024*: Within
49-
> `extern` blocks, the `safe` or `unsafe` function qualifier is only allowed
50-
> when the `extern` is qualified as `unsafe`.
51-
>
5248
> [^fn-param-2015]: Function parameters with only a type are only allowed
5349
> in an associated function of a [trait item] in the 2015 edition.
5450

src/unsafe-keyword.md

-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,4 @@ Unsafe trait implementations are the logical dual to unsafe traits: where unsafe
6161

6262
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`.
6363

64-
**Edition differences**: Prior to edition 2024, `extern` blocks were allowed without being qualified as `unsafe`.
65-
6664
[external block]: items/external-blocks.md

src/unsafety.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ Rust:
1111
- Accessing a field of a [`union`], other than to assign to it.
1212
- Calling an unsafe function (including an intrinsic or foreign function).
1313
- Implementing an [unsafe trait].
14-
- Declaring an [`extern`] block[^extern-2024].
15-
16-
[^extern-2024]: Prior to the 2024 edition, extern blocks were allowed to be declared without `unsafe`.
14+
- Declaring an [`extern`] block.
1715

1816
[`extern`]: items/external-blocks.md
1917
[`union`]: items/unions.md

0 commit comments

Comments
 (0)