From 921ed7cdccae64c82a18880c2ad5112286d4b1f9 Mon Sep 17 00:00:00 2001 From: Matthew Woodcraft Date: Sat, 7 May 2022 11:11:58 +0100 Subject: [PATCH 1/2] Stop saying that const functions cannot use 'extern' --- src/items/functions.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/items/functions.md b/src/items/functions.md index adffd2af4..f4837e0af 100644 --- a/src/items/functions.md +++ b/src/items/functions.md @@ -216,8 +216,7 @@ 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 are not allowed to be [async](#async-functions). ## Async functions From dd32a8ea8cc4de83c00d6a01047d181567d04693 Mon Sep 17 00:00:00 2001 From: Matthew Woodcraft Date: Mon, 9 May 2022 19:34:15 +0100 Subject: [PATCH 2/2] Say that `const extern` functions can only use "Rust" or "C" --- src/items/functions.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/items/functions.md b/src/items/functions.md index f4837e0af..6a2ab4e16 100644 --- a/src/items/functions.md +++ b/src/items/functions.md @@ -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 @@ -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