Skip to content

Commit

Permalink
Merge pull request #1207 from mattheww/2022-05_const_extern_fn
Browse files Browse the repository at this point in the history
Stop saying that const functions cannot use 'extern'
  • Loading branch information
ehuss committed May 10, 2022
2 parents b8ac38e + dd32a8e commit 8e36971
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/items/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ Functions qualified with the `const` keyword are [const functions], as are
[tuple struct] and [tuple variant] constructors. _Const functions_ can be
called from within [const contexts].

Const functions are not allowed to be [async](#async-functions), and cannot
use the [`extern` function qualifier](#extern-function-qualifier).
Const functions may use the [`extern`] function qualifier, but only with the `"Rust"` and `"C"` ABIs.

Const functions are not allowed to be [async](#async-functions).

## Async functions

Expand Down Expand Up @@ -383,6 +384,7 @@ fn foo_oof(#[some_inert_attribute] arg: u8) {
[const functions]: ../const_eval.md#const-functions
[tuple struct]: structs.md
[tuple variant]: enumerations.md
[`extern`]: #extern-function-qualifier
[external block]: external-blocks.md
[path]: ../paths.md
[block]: ../expressions/block-expr.md
Expand Down

0 comments on commit 8e36971

Please sign in to comment.