File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -381,11 +381,13 @@ mod enum_keyword {}
381381/// lazy_static;`. The other use is in foreign function interfaces (FFI).
382382///
383383/// `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.
384+ /// 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.
385387///
386388/// ```rust ignore
387389/// #[link(name = "my_c_library")]
388- /// extern "C" {
390+ /// unsafe extern "C" {
389391/// fn my_c_function(x: i32) -> bool;
390392/// }
391393/// ```
You can’t perform that action at this time.
0 commit comments