Update text/0000-unsafe-extern-blocks.md

Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
This commit is contained in:
Lokathor 2024-03-31 17:23:56 -06:00 committed by GitHub
parent 7754241faf
commit 2144ac3f15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ An extern function is declared with a `;` instead of a function body (similar to
An extern static value is also declared with a `;` instead of an expression (similar to an associated const of a trait).
In both cases, the actual function body or value is provided by whatever external source (which is probably not even written in Rust).
When an `unsafe extern` block is used, all declarations within that `extern` block *should* have the `unsafe` or `safe` keywords as part of their signature.
When an `unsafe extern` block is used, all declarations within that `extern` block *must* have the `unsafe` or `safe` keywords as part of their signature.
If one of the two keywords is not explicitly provided, the declaration is assumed to be `unsafe`, and also a warning is generated.
The `safe` keyword is a contextual keyword, it is currently only used within `extern` blocks.