We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
extern
1 parent 553600e commit 28b4ad6Copy full SHA for 28b4ad6
library/std/src/keyword_docs.rs
@@ -381,11 +381,13 @@ mod enum_keyword {}
381
/// lazy_static;`. The other use is in foreign function interfaces (FFI).
382
///
383
/// `extern` is used in two different contexts within FFI. The first is in the form of external
384
-/// blocks, for declaring function interfaces that Rust code can call foreign code by.
+/// blocks, for declaring function interfaces that Rust code can call foreign code by. Starting
385
+/// with Rust 2024, external blocks must be marked as `unsafe`. In earlier editions, use of
386
+/// the `unsafe` keyword remains optional.
387
388
/// ```rust ignore
389
/// #[link(name = "my_c_library")]
-/// extern "C" {
390
+/// unsafe extern "C" {
391
/// fn my_c_function(x: i32) -> bool;
392
/// }
393
/// ```
0 commit comments