Skip to content

Commit

Permalink
docs: add additional links for ffi_pure / ffi_const
Browse files Browse the repository at this point in the history
  • Loading branch information
midgleyc committed Jul 21, 2021
1 parent 27ffc37 commit 3e981e2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0757.md
Expand Up @@ -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)]
Expand All @@ -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

0 comments on commit 3e981e2

Please sign in to comment.