File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -381,9 +381,13 @@ mod enum_keyword {}
381
381
/// lazy_static;`. The other use is in foreign function interfaces (FFI).
382
382
///
383
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.
384
+ /// blocks, for declaring function interfaces that Rust code can call foreign code by. This use
385
+ /// of `extern` is unsafe, since we are asserting to the compiler that all function declarations
386
+ /// are correct. If they are not, using these items may lead to undefined behavior.
385
387
///
386
388
/// ```rust ignore
389
+ /// // SAFETY: The function declarations given below are in
390
+ /// // line with the header files of `my_c_library`.
387
391
/// #[link(name = "my_c_library")]
388
392
/// unsafe extern "C" {
389
393
/// fn my_c_function(x: i32) -> bool;
You can’t perform that action at this time.
0 commit comments