File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/doc/unstable-book/src/language-features Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ # ` explicit_extern_abis `
2+
3+ The tracking issue for this feature is: #134986
4+
5+ ------
6+
7+ Disallow ` extern ` without an explicit ABI. We should write ` extern "C" `
8+ (or another ABI) instead of just ` extern ` .
9+
10+ By making the ABI explicit, it becomes much clearer that "C" is just one of the
11+ possible choices, rather than the "standard" way for external functions.
12+ Removing the default makes it easier to add a new ABI on equal footing as "C".
13+
14+ ``` rust,editionfuture,compile_fail
15+ #![feature(explicit_extern_abis)]
16+
17+ extern fn function1() {} // ERROR extern declarations without an explicit ABI
18+ // are disallowed
19+
20+ extern "C" fn function2() {} // compile
21+
22+ extern "aapcs" fn function3() {} // compile
23+ ```
You can’t perform that action at this time.
0 commit comments