1 A function was given both the `ffi_const` and `ffi_pure` attributes.
3 Erroneous code example:
6 #![feature(ffi_const, ffi_pure)]
10 #[ffi_pure] // error: `#[ffi_const]` function cannot be `#[ffi_pure]`
11 pub fn square(num: i32) -> i32;
15 As `ffi_const` provides stronger guarantees than `ffi_pure`, remove the
19 #![feature(ffi_const)]
23 pub fn square(num: i32) -> i32;
27 You can get more information about `const` and `pure` in the [GCC documentation
28 on Common Function Attributes]. The unstable Rust Book has more information
29 about [`ffi_const`] and [`ffi_pure`].
31 [GCC documentation on Common Function Attributes]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
32 [`ffi_const`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/ffi-const.html
33 [`ffi_pure`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/ffi-pure.html