Skip to content

Commit 5e02c27

Browse files
committed
Add back the ? for unsafe in extern blocks.
The grammar is intended to show the AST before validation. This is the grammar accepted by macros, for example.
1 parent 5a8f0e6 commit 5e02c27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/items/external-blocks.md

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

33
> **<sup>Syntax</sup>**\
44
> _ExternBlock_ :\
5-
> &nbsp;&nbsp; `unsafe`[^unsafe-2024] `extern` [_Abi_]<sup>?</sup> `{`\
5+
> &nbsp;&nbsp; `unsafe`<sup>?</sup>[^unsafe-2024] `extern` [_Abi_]<sup>?</sup> `{`\
66
> &nbsp;&nbsp; &nbsp;&nbsp; [_InnerAttribute_]<sup>\*</sup>\
77
> &nbsp;&nbsp; &nbsp;&nbsp; _ExternalItem_<sup>\*</sup>\
88
> &nbsp;&nbsp; `}`
@@ -13,7 +13,7 @@
1313
> &nbsp;&nbsp; &nbsp;&nbsp; | ( [_Visibility_]<sup>?</sup> ( (`safe` | `unsafe`)<sup>?</sup>[^static-qualifiers] [_StaticItem_] | [_Function_] ) )\
1414
> &nbsp;&nbsp; )
1515
>
16-
> [^unsafe-2024]: Prior to the 2024 edition, the `unsafe` keyword is optional.
16+
> [^unsafe-2024]: Starting with the 2024 Edition, the `unsafe` keyword is required semantically.
1717
>
1818
> [^static-qualifiers]: *Relevant to editions earlier than Rust 2024*: The `safe` or `unsafe` qualifier is only allowed when the `extern` is qualified as `unsafe`.
1919

0 commit comments

Comments
 (0)