From 3e981e220940c86b57ebab8413d9855af3bbda8c Mon Sep 17 00:00:00 2001 From: Chris Midgley Date: Wed, 21 Jul 2021 14:11:14 +0100 Subject: [PATCH] docs: add additional links for ffi_pure / ffi_const --- compiler/rustc_error_codes/src/error_codes/E0757.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0757.md b/compiler/rustc_error_codes/src/error_codes/E0757.md index 03ab4e7699d..ed7ee1c6fa2 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0757.md +++ b/compiler/rustc_error_codes/src/error_codes/E0757.md @@ -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