docs: add additional links for ffi_pure / ffi_const

This commit is contained in:
Chris Midgley 2021-07-21 14:11:14 +01:00
parent 27ffc3725a
commit 3e981e2209

View File

@ -12,8 +12,8 @@ extern "C" {
}
```
As `const` has a stricter set of requirements than `pure`, remove the `ffi_pure`
attribute:
As `ffi_const` has a stricter set of requirements than `ffi_pure`, remove the
`ffi_pure` attribute:
```
#![feature(ffi_const)]
@ -23,3 +23,11 @@ extern "C" {
pub fn square(num: i32) -> i32;
}
```
You can get more information about `const` and `pure` in the [GCC documentation
on Common Function Attributes]. The unstable Rust Book has more information
about [`ffi_const`] and [`ffi_pure`].
[GCC documentation on Common Function Attributes]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
[`ffi_const`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/ffi-const.html
[`ffi_pure`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/ffi-pure.html