diff options
| author | Obei Sideg <obei.sideg@gmail.com> | 2025-04-08 05:29:19 +0300 |
|---|---|---|
| committer | Obei Sideg <obei.sideg@gmail.com> | 2025-04-15 14:33:19 +0300 |
| commit | ee53c26b41a74eb0ecf785e8cfac98e5aa980756 (patch) | |
| tree | af9ce3475f7897bb37682d8f3189b4f46bfaafea /src/doc | |
| parent | c580c498a1fe144d7c5b2dfc7faab1a229aa288b (diff) | |
| download | rust-ee53c26b41a74eb0ecf785e8cfac98e5aa980756.tar.gz rust-ee53c26b41a74eb0ecf785e8cfac98e5aa980756.zip | |
Add `explicit_extern_abis` unstable feature
also add `explicit-extern-abis` feature section to the unstable book.
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/unstable-book/src/language-features/explicit-extern-abis.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/language-features/explicit-extern-abis.md b/src/doc/unstable-book/src/language-features/explicit-extern-abis.md new file mode 100644 index 00000000000..ba622466ba7 --- /dev/null +++ b/src/doc/unstable-book/src/language-features/explicit-extern-abis.md @@ -0,0 +1,23 @@ +# `explicit_extern_abis` + +The tracking issue for this feature is: #134986 + +------ + +Disallow `extern` without an explicit ABI. We should write `extern "C"` +(or another ABI) instead of just `extern`. + +By making the ABI explicit, it becomes much clearer that "C" is just one of the +possible choices, rather than the "standard" way for external functions. +Removing the default makes it easier to add a new ABI on equal footing as "C". + +```rust,editionfuture,compile_fail +#![feature(explicit_extern_abis)] + +extern fn function1() {} // ERROR `extern` declarations without an explicit ABI + // are disallowed + +extern "C" fn function2() {} // compiles + +extern "aapcs" fn function3() {} // compiles +``` |
