Skip to content

Commit 5cc4cc3

Browse files
committed
Clarify that we will "eventually" lint
This RFC means to specify that we will *eventually* issue a lint in all editions when `extern` is not prefixed with `unsafe`. Let's specify this more clearly. (Thanks to Waffle and joshtriplett for raising this point.)
1 parent fc53654 commit 5cc4cc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

text/0000-unsafe-extern-blocks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Rust can utilize functions and statics from foreign code that are provided durin
2626
An `extern` block can be placed anywhere a function declaration could appear (generally at the top level of a module).
2727

2828
* On editions >= 2024, you *must* write all `extern` blocks as `unsafe extern`.
29-
* On editions < 2024, you *may* write `unsafe extern`, or you can write an `extern` block without the `unsafe` keyword. Writing an `extern` block without the `unsafe` keyword is provided for compatibility only, and will generate a warning.
29+
* On editions < 2024, you *may* write `unsafe extern`, or you can write an `extern` block without the `unsafe` keyword. Writing an `extern` block without the `unsafe` keyword is provided for compatibility only, and will eventually generate a warning.
3030
* `unsafe extern` interacts with the `unsafe_code` lint, and a `deny` or `forbid` with that lint will deny or forbid the unsafe external block.
3131

3232
Within an `extern` block is zero or more declarations of external functions and/or external static values.
@@ -72,7 +72,7 @@ They can only be used within an `unsafe` block.
7272
The grammar of the language is updated so that:
7373

7474
* Editions >= 2024 *must* prefix all `extern` blocks with `unsafe`.
75-
* Editions < 2024 *should* prefix `extern` blocks with `unsafe`, this is a warn-by-default compatibility lint when `unsafe` is missing.
75+
* Editions < 2024 *should* prefix `extern` blocks with `unsafe`, this will eventually be a warn-by-default compatibility lint when `unsafe` is missing.
7676

7777
This RFC replaces the *["functions"][]* and *["statics"][]* sections in the [external blocks][] chapter of the Rust Reference with the following:
7878

0 commit comments

Comments
 (0)