Skip to content

Commit 60693ad

Browse files
committed
Add explicit_extern_abis unstable feature
1 parent cdd8af2 commit 60693ad

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

compiler/rustc_feature/src/unstable.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ declare_features! (
478478
(incomplete, ergonomic_clones, "CURRENT_RUSTC_VERSION", Some(132290)),
479479
/// Allows exhaustive pattern matching on types that contain uninhabited types.
480480
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
481+
/// Disallows `extern` without an explicit ABIs.
482+
(unstable, explicit_extern_abis, "CURRENT_RUSTC_VERSION", Some(134986)),
481483
/// Allows explicit tail calls via `become` expression.
482484
(incomplete, explicit_tail_calls, "1.72.0", Some(112788)),
483485
/// Allows using `aapcs`, `efiapi`, `sysv64` and `win64` as calling conventions

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ symbols! {
881881
expf16,
882882
expf32,
883883
expf64,
884+
explicit_extern_abis,
884885
explicit_generic_args_with_impl_trait,
885886
explicit_tail_calls,
886887
export_name,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#![feature(explicit_extern_abis)]
2+
3+
extern fn foo() {}
4+
//~^ ERROR extern declarations without an explicit ABI are disallowed
5+
6+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: extern declarations without an explicit ABI are disallowed
2+
--> $DIR/feature-gate-explicit-extern-abis.rs:3:1
3+
|
4+
LL | extern fn foo() {}
5+
| ^^^^^^
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)