rollup merge of #18347 : cakebaker/ffi
This commit is contained in:
commit
a1d719dad4
@ -5339,9 +5339,9 @@ There are two circumstances where Rust's safety provisions don't work well.
|
|||||||
The first is when interfacing with C code, and the second is when building
|
The first is when interfacing with C code, and the second is when building
|
||||||
certain kinds of abstractions.
|
certain kinds of abstractions.
|
||||||
|
|
||||||
Rust has support for FFI (which you can read about in the [FFI
|
Rust has support for [FFI](http://en.wikipedia.org/wiki/Foreign_function_interface)
|
||||||
Guide](guide-ffi.html)), but can't guarantee that the C code will be safe.
|
(which you can read about in the [FFI Guide](guide-ffi.html)), but can't guarantee
|
||||||
Therefore, Rust marks such functions with the `unsafe`
|
that the C code will be safe. Therefore, Rust marks such functions with the `unsafe`
|
||||||
keyword, which indicates that the function may not behave properly.
|
keyword, which indicates that the function may not behave properly.
|
||||||
|
|
||||||
Second, if you'd like to create some sort of shared-memory data structure, Rust
|
Second, if you'd like to create some sort of shared-memory data structure, Rust
|
||||||
|
Loading…
x
Reference in New Issue
Block a user