about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev+love@gmail.com>2023-01-13 05:47:21 +0900
committerGitHub <noreply@github.com>2023-01-13 05:47:21 +0900
commitfa8f77a1deb0952fa81fd4f2f0809ceec8d7f7e8 (patch)
tree71d0334f6ff4187b0aeb1a431fc098094f95a679
parent1bc3683b3275a5eb2ed13d24edcdcbc59afe5d70 (diff)
parent46f9e878f68e6ece9e8dad54c67e97e5dd5838e1 (diff)
downloadrust-fa8f77a1deb0952fa81fd4f2f0809ceec8d7f7e8.tar.gz
rust-fa8f77a1deb0952fa81fd4f2f0809ceec8d7f7e8.zip
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
Stabilize `abi_efiapi` feature

Tracking issue: https://github.com/rust-lang/rust/issues/65815
Closes #65815
-rw-r--r--compiler/rustc_feature/src/accepted.rs2
-rw-r--r--compiler/rustc_feature/src/active.rs2
-rw-r--r--compiler/rustc_target/src/spec/abi.rs6
-rw-r--r--src/doc/unstable-book/src/language-features/abi-efiapi.md23
-rw-r--r--tests/codegen/abi-efiapi.rs2
-rw-r--r--tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs2
-rw-r--r--tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr12
-rw-r--r--tests/ui/c-variadic/variadic-ffi-2.rs1
-rw-r--r--tests/ui/c-variadic/variadic-ffi-2.stderr2
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-efiapi.rs33
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-efiapi.stderr66
11 files changed, 11 insertions, 140 deletions
diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs
index fcbc5bacfcc..aab4b604fad 100644
--- a/compiler/rustc_feature/src/accepted.rs
+++ b/compiler/rustc_feature/src/accepted.rs
@@ -48,6 +48,8 @@ declare_features! (
 
     /// Allows `#[target_feature(...)]` on aarch64 platforms
     (accepted, aarch64_target_feature, "1.61.0", Some(44839), None),
+    /// Allows using the `efiapi` ABI.
+    (accepted, abi_efiapi, "CURRENT_RUSTC_VERSION", Some(65815), None),
     /// Allows the sysV64 ABI to be specified on all platforms
     /// instead of just the platforms on which it is the C ABI.
     (accepted, abi_sysv64, "1.24.0", Some(36167), None),
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs
index f0bc35d06bf..531ddcc1fa6 100644
--- a/compiler/rustc_feature/src/active.rs
+++ b/compiler/rustc_feature/src/active.rs
@@ -281,8 +281,6 @@ declare_features! (
     (active, abi_avr_interrupt, "1.45.0", Some(69664), None),
     /// Allows `extern "C-cmse-nonsecure-call" fn()`.
     (active, abi_c_cmse_nonsecure_call, "1.51.0", Some(81391), None),
-    /// Allows using the `efiapi` ABI.
-    (active, abi_efiapi, "1.40.0", Some(65815), None),
     /// Allows `extern "msp430-interrupt" fn()`.
     (active, abi_msp430_interrupt, "1.16.0", Some(38487), None),
     /// Allows `extern "ptx-*" fn()`.
diff --git a/compiler/rustc_target/src/spec/abi.rs b/compiler/rustc_target/src/spec/abi.rs
index cb2a0c04c6a..d4f7ed31b89 100644
--- a/compiler/rustc_target/src/spec/abi.rs
+++ b/compiler/rustc_target/src/spec/abi.rs
@@ -149,7 +149,7 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
     match name {
         // Stable
         "Rust" | "C" | "cdecl" | "stdcall" | "fastcall" | "aapcs" | "win64" | "sysv64"
-        | "system" => Ok(()),
+        | "system" | "efiapi" => Ok(()),
         "rust-intrinsic" => Err(AbiDisabled::Unstable {
             feature: sym::intrinsics,
             explain: "intrinsics are subject to change",
@@ -198,10 +198,6 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
             feature: sym::abi_avr_interrupt,
             explain: "avr-interrupt and avr-non-blocking-interrupt ABIs are experimental and subject to change",
         }),
-        "efiapi" => Err(AbiDisabled::Unstable {
-            feature: sym::abi_efiapi,
-            explain: "efiapi ABI is experimental and subject to change",
-        }),
         "C-cmse-nonsecure-call" => Err(AbiDisabled::Unstable {
             feature: sym::abi_c_cmse_nonsecure_call,
             explain: "C-cmse-nonsecure-call ABI is experimental and subject to change",
diff --git a/src/doc/unstable-book/src/language-features/abi-efiapi.md b/src/doc/unstable-book/src/language-features/abi-efiapi.md
deleted file mode 100644
index b492da88474..00000000000
--- a/src/doc/unstable-book/src/language-features/abi-efiapi.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# `abi_efiapi`
-
-The tracking issue for this feature is: [#65815]
-
-[#65815]: https://github.com/rust-lang/rust/issues/65815
-
-------------------------
-
-The `efiapi` calling convention can be used for defining a function with
-an ABI compatible with the UEFI Interfaces as defined in the [UEFI
-Specification].
-
-Example:
-
-```rust,ignore (not-all-targets-support-uefi)
-#![feature(abi_efiapi)]
-
-extern "efiapi" { fn f1(); }
-
-extern "efiapi" fn f2() { todo!() }
-```
-
-[UEFI Specification]: https://uefi.org/specs/UEFI/2.10/
diff --git a/tests/codegen/abi-efiapi.rs b/tests/codegen/abi-efiapi.rs
index 9061d7432a3..9502ebf59af 100644
--- a/tests/codegen/abi-efiapi.rs
+++ b/tests/codegen/abi-efiapi.rs
@@ -14,7 +14,7 @@
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-#![feature(no_core, lang_items, abi_efiapi)]
+#![feature(no_core, lang_items)]
 #![no_core]
 
 #[lang="sized"]
diff --git a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs b/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs
index 087743e505d..fce6210b2f4 100644
--- a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs
+++ b/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs
@@ -1,5 +1,3 @@
-#![feature(abi_efiapi)]
-
 fn efiapi(f: extern "efiapi" fn(usize, ...)) {
     //~^ ERROR: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
     //~^^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
diff --git a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr b/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr
index 007d7d7953c..5b97b396fb1 100644
--- a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr
+++ b/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr
@@ -1,5 +1,5 @@
 error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
-  --> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14
+  --> $DIR/feature-gate-extended_varargs_abi_support.rs:1:14
    |
 LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) {
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,13 +8,13 @@ LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) {
    = help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
 
 error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
-  --> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14
+  --> $DIR/feature-gate-extended_varargs_abi_support.rs:1:14
    |
 LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) {
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
 
 error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
-  --> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12
+  --> $DIR/feature-gate-extended_varargs_abi_support.rs:6:12
    |
 LL | fn sysv(f: extern "sysv64" fn(usize, ...)) {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,13 +23,13 @@ LL | fn sysv(f: extern "sysv64" fn(usize, ...)) {
    = help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
 
 error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
-  --> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12
+  --> $DIR/feature-gate-extended_varargs_abi_support.rs:6:12
    |
 LL | fn sysv(f: extern "sysv64" fn(usize, ...)) {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
 
 error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
-  --> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11
+  --> $DIR/feature-gate-extended_varargs_abi_support.rs:11:11
    |
 LL | fn win(f: extern "win64" fn(usize, ...)) {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -38,7 +38,7 @@ LL | fn win(f: extern "win64" fn(usize, ...)) {
    = help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
 
 error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
-  --> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11
+  --> $DIR/feature-gate-extended_varargs_abi_support.rs:11:11
    |
 LL | fn win(f: extern "win64" fn(usize, ...)) {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
diff --git a/tests/ui/c-variadic/variadic-ffi-2.rs b/tests/ui/c-variadic/variadic-ffi-2.rs
index 96cea87546e..c34b7e55f6a 100644
--- a/tests/ui/c-variadic/variadic-ffi-2.rs
+++ b/tests/ui/c-variadic/variadic-ffi-2.rs
@@ -1,6 +1,5 @@
 // ignore-arm stdcall isn't supported
 #![feature(extended_varargs_abi_support)]
-#![feature(abi_efiapi)]
 
 fn baz(f: extern "stdcall" fn(usize, ...)) {
     //~^ ERROR: C-variadic function must have a compatible calling convention,
diff --git a/tests/ui/c-variadic/variadic-ffi-2.stderr b/tests/ui/c-variadic/variadic-ffi-2.stderr
index 4e74c9d9227..e21001ecaf8 100644
--- a/tests/ui/c-variadic/variadic-ffi-2.stderr
+++ b/tests/ui/c-variadic/variadic-ffi-2.stderr
@@ -1,5 +1,5 @@
 error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `win64`, `sysv64` or `efiapi`
-  --> $DIR/variadic-ffi-2.rs:5:11
+  --> $DIR/variadic-ffi-2.rs:4:11
    |
 LL | fn baz(f: extern "stdcall" fn(usize, ...)) {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
diff --git a/tests/ui/feature-gates/feature-gate-abi-efiapi.rs b/tests/ui/feature-gates/feature-gate-abi-efiapi.rs
deleted file mode 100644
index 0c0d736acd0..00000000000
--- a/tests/ui/feature-gates/feature-gate-abi-efiapi.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// needs-llvm-components: x86
-// compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib
-#![no_core]
-#![feature(no_core, lang_items)]
-#[lang="sized"]
-trait Sized { }
-
-// Functions
-extern "efiapi" fn f1() {} //~ ERROR efiapi ABI is experimental
-
-// Methods in trait defintion
-trait Tr {
-    extern "efiapi" fn f2(); //~ ERROR efiapi ABI is experimental
-    extern "efiapi" fn f3() {} //~ ERROR efiapi ABI is experimental
-}
-
-struct S;
-
-// Methods in trait impl
-impl Tr for S {
-    extern "efiapi" fn f2() {} //~ ERROR efiapi ABI is experimental
-}
-
-// Methods in inherent impl
-impl S {
-    extern "efiapi" fn f4() {} //~ ERROR efiapi ABI is experimental
-}
-
-// Function pointer types
-type A = extern "efiapi" fn(); //~ ERROR efiapi ABI is experimental
-
-// Foreign modules
-extern "efiapi" {} //~ ERROR efiapi ABI is experimental
diff --git a/tests/ui/feature-gates/feature-gate-abi-efiapi.stderr b/tests/ui/feature-gates/feature-gate-abi-efiapi.stderr
deleted file mode 100644
index 5b01dcc6d85..00000000000
--- a/tests/ui/feature-gates/feature-gate-abi-efiapi.stderr
+++ /dev/null
@@ -1,66 +0,0 @@
-error[E0658]: efiapi ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-efiapi.rs:9:8
-   |
-LL | extern "efiapi" fn f1() {}
-   |        ^^^^^^^^
-   |
-   = note: see issue #65815 <https://github.com/rust-lang/rust/issues/65815> for more information
-   = help: add `#![feature(abi_efiapi)]` to the crate attributes to enable
-
-error[E0658]: efiapi ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-efiapi.rs:13:12
-   |
-LL |     extern "efiapi" fn f2();
-   |            ^^^^^^^^
-   |
-   = note: see issue #65815 <https://github.com/rust-lang/rust/issues/65815> for more information
-   = help: add `#![feature(abi_efiapi)]` to the crate attributes to enable
-
-error[E0658]: efiapi ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-efiapi.rs:14:12
-   |
-LL |     extern "efiapi" fn f3() {}
-   |            ^^^^^^^^
-   |
-   = note: see issue #65815 <https://github.com/rust-lang/rust/issues/65815> for more information
-   = help: add `#![feature(abi_efiapi)]` to the crate attributes to enable
-
-error[E0658]: efiapi ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-efiapi.rs:21:12
-   |
-LL |     extern "efiapi" fn f2() {}
-   |            ^^^^^^^^
-   |
-   = note: see issue #65815 <https://github.com/rust-lang/rust/issues/65815> for more information
-   = help: add `#![feature(abi_efiapi)]` to the crate attributes to enable
-
-error[E0658]: efiapi ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-efiapi.rs:26:12
-   |
-LL |     extern "efiapi" fn f4() {}
-   |            ^^^^^^^^
-   |
-   = note: see issue #65815 <https://github.com/rust-lang/rust/issues/65815> for more information
-   = help: add `#![feature(abi_efiapi)]` to the crate attributes to enable
-
-error[E0658]: efiapi ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-efiapi.rs:30:17
-   |
-LL | type A = extern "efiapi" fn();
-   |                 ^^^^^^^^
-   |
-   = note: see issue #65815 <https://github.com/rust-lang/rust/issues/65815> for more information
-   = help: add `#![feature(abi_efiapi)]` to the crate attributes to enable
-
-error[E0658]: efiapi ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-efiapi.rs:33:8
-   |
-LL | extern "efiapi" {}
-   |        ^^^^^^^^
-   |
-   = note: see issue #65815 <https://github.com/rust-lang/rust/issues/65815> for more information
-   = help: add `#![feature(abi_efiapi)]` to the crate attributes to enable
-
-error: aborting due to 7 previous errors
-
-For more information about this error, try `rustc --explain E0658`.