Skip to content

Commit

Permalink
Say that const extern functions can only use "Rust" or "C"
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheww committed May 9, 2022
1 parent 921ed7c commit dd32a8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/items/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ 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 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 @@ -382,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 dd32a8e

Please sign in to comment.