about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-02 00:45:04 +0000
committerbors <bors@rust-lang.org>2023-05-02 00:45:04 +0000
commit1cb63572d271855a5ccef79a3e10a8015d00f6ad (patch)
tree96a9a2f55928d10c7d209c51eda0041d159a2503
parentd6ddee637b62c6c4cdee90d98c3a21a1325a8e81 (diff)
parentc9a0be27ac798936c2ff40d2875c696e48b34e62 (diff)
downloadrust-1cb63572d271855a5ccef79a3e10a8015d00f6ad.tar.gz
rust-1cb63572d271855a5ccef79a3e10a8015d00f6ad.zip
Auto merge of #106075 - nbdd0121:ffi-unwind, r=joshtriplett
Partial stabilisation of `c_unwind`

The stabilisation report is at https://github.com/rust-lang/rust/issues/74990#issuecomment-1363473645

cc `@rust-lang/wg-ffi-unwind`
-rw-r--r--compiler/rustc_feature/src/active.rs2
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs4
-rw-r--r--compiler/rustc_target/src/spec/abi.rs53
-rw-r--r--library/panic_unwind/src/emcc.rs2
-rw-r--r--library/panic_unwind/src/gcc.rs4
-rw-r--r--library/panic_unwind/src/seh.rs2
-rw-r--r--tests/run-make/c-unwind-abi-catch-lib-panic/main.rs1
-rw-r--r--tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs1
-rw-r--r--tests/run-make/c-unwind-abi-catch-panic/main.rs1
-rw-r--r--tests/run-make/foreign-double-unwind/foo.rs2
-rw-r--r--tests/run-make/foreign-exceptions/foo.rs2
-rw-r--r--tests/run-make/foreign-rust-exceptions/bar.rs1
-rw-r--r--tests/run-make/foreign-rust-exceptions/foo.rs2
-rw-r--r--tests/rustdoc-json/fn_pointer/abi.rs1
-rw-r--r--tests/rustdoc-json/fns/abi.rs1
-rw-r--r--tests/rustdoc-json/methods/abi.rs1
-rw-r--r--tests/ui/feature-gates/feature-gate-thiscall.rs (renamed from tests/ui/unwind-abis/feature-gate-thiscall-unwind.rs)5
-rw-r--r--tests/ui/feature-gates/feature-gate-thiscall.stderr (renamed from tests/ui/unwind-abis/feature-gate-thiscall-unwind.stderr)49
-rw-r--r--tests/ui/feature-gates/feature-gate-vectorcall.rs4
-rw-r--r--tests/ui/panic-runtime/auxiliary/needs-unwind.rs1
-rw-r--r--tests/ui/stability-attribute/stability-attribute-trait-impl.rs6
-rw-r--r--tests/ui/stability-attribute/stability-attribute-trait-impl.stderr2
-rw-r--r--tests/ui/unwind-abis/feature-gate-c-unwind-enabled.rs12
-rw-r--r--tests/ui/unwind-abis/feature-gate-c-unwind.rs13
-rw-r--r--tests/ui/unwind-abis/feature-gate-c-unwind.stderr33
-rw-r--r--tests/ui/unwind-abis/feature-gate-c_unwind.rs4
-rw-r--r--tests/ui/unwind-abis/feature-gate-stdcall-unwind.rs30
-rw-r--r--tests/ui/unwind-abis/feature-gate-stdcall-unwind.stderr66
-rw-r--r--tests/ui/unwind-abis/feature-gate-system-unwind.rs9
-rw-r--r--tests/ui/unwind-abis/feature-gate-system-unwind.stderr12
-rw-r--r--tests/ui/unwind-abis/ffi-unwind-calls-lint.rs1
-rw-r--r--tests/ui/unwind-abis/ffi-unwind-calls-lint.stderr6
32 files changed, 53 insertions, 280 deletions
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs
index 052d312d9a0..f046022b842 100644
--- a/compiler/rustc_feature/src/active.rs
+++ b/compiler/rustc_feature/src/active.rs
@@ -311,7 +311,7 @@ declare_features! (
     (active, async_closure, "1.37.0", Some(62290), None),
     /// Allows async functions to be declared, implemented, and used in traits.
     (incomplete, async_fn_in_trait, "1.66.0", Some(91611), None),
-    /// Allows `extern "C-unwind" fn` to enable unwinding across ABI boundaries.
+    /// Treat `extern "C"` function as nounwind.
     (active, c_unwind, "1.52.0", Some(74990), None),
     /// Allows using C-variadics.
     (active, c_variadic, "1.34.0", Some(44930), None),
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index a3d7bd3ef59..6fe15e21d94 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -4014,7 +4014,6 @@ declare_lint! {
     /// ### Example
     ///
     /// ```rust
-    /// #![feature(c_unwind)]
     /// #![warn(ffi_unwind_calls)]
     ///
     /// extern "C-unwind" {
@@ -4037,8 +4036,7 @@ declare_lint! {
     /// that desire this ability it is therefore necessary to avoid such calls.
     pub FFI_UNWIND_CALLS,
     Allow,
-    "call to foreign functions or function pointers with FFI-unwind ABI",
-    @feature_gate = sym::c_unwind;
+    "call to foreign functions or function pointers with FFI-unwind ABI"
 }
 
 declare_lint! {
diff --git a/compiler/rustc_target/src/spec/abi.rs b/compiler/rustc_target/src/spec/abi.rs
index 5582d909f6b..eb3f66ac308 100644
--- a/compiler/rustc_target/src/spec/abi.rs
+++ b/compiler/rustc_target/src/spec/abi.rs
@@ -148,8 +148,9 @@ pub fn is_enabled(
 pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
     match name {
         // Stable
-        "Rust" | "C" | "cdecl" | "stdcall" | "fastcall" | "aapcs" | "win64" | "sysv64"
-        | "system" | "efiapi" => Ok(()),
+        "Rust" | "C" | "C-unwind" | "cdecl" | "cdecl-unwind" | "stdcall" | "stdcall-unwind"
+        | "fastcall" | "fastcall-unwind" | "aapcs" | "aapcs-unwind" | "win64" | "win64-unwind"
+        | "sysv64" | "sysv64-unwind" | "system" | "system-unwind" | "efiapi" => Ok(()),
         "rust-intrinsic" => Err(AbiDisabled::Unstable {
             feature: sym::intrinsics,
             explain: "intrinsics are subject to change",
@@ -162,10 +163,18 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
             feature: sym::abi_vectorcall,
             explain: "vectorcall is experimental and subject to change",
         }),
+        "vectorcall-unwind" => Err(AbiDisabled::Unstable {
+            feature: sym::abi_vectorcall,
+            explain: "vectorcall-unwind ABI is experimental and subject to change",
+        }),
         "thiscall" => Err(AbiDisabled::Unstable {
             feature: sym::abi_thiscall,
             explain: "thiscall is experimental and subject to change",
         }),
+        "thiscall-unwind" => Err(AbiDisabled::Unstable {
+            feature: sym::abi_thiscall,
+            explain: "thiscall-unwind ABI is experimental and subject to change",
+        }),
         "rust-call" => Err(AbiDisabled::Unstable {
             feature: sym::unboxed_closures,
             explain: "rust-call ABI is subject to change",
@@ -202,46 +211,6 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
             feature: sym::abi_c_cmse_nonsecure_call,
             explain: "C-cmse-nonsecure-call ABI is experimental and subject to change",
         }),
-        "C-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "C-unwind ABI is experimental and subject to change",
-        }),
-        "stdcall-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "stdcall-unwind ABI is experimental and subject to change",
-        }),
-        "system-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "system-unwind ABI is experimental and subject to change",
-        }),
-        "thiscall-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "thiscall-unwind ABI is experimental and subject to change",
-        }),
-        "cdecl-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "cdecl-unwind ABI is experimental and subject to change",
-        }),
-        "fastcall-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "fastcall-unwind ABI is experimental and subject to change",
-        }),
-        "vectorcall-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "vectorcall-unwind ABI is experimental and subject to change",
-        }),
-        "aapcs-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "aapcs-unwind ABI is experimental and subject to change",
-        }),
-        "win64-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "win64-unwind ABI is experimental and subject to change",
-        }),
-        "sysv64-unwind" => Err(AbiDisabled::Unstable {
-            feature: sym::c_unwind,
-            explain: "sysv64-unwind ABI is experimental and subject to change",
-        }),
         "wasm" => Err(AbiDisabled::Unstable {
             feature: sym::wasm_abi,
             explain: "wasm ABI is experimental and subject to change",
diff --git a/library/panic_unwind/src/emcc.rs b/library/panic_unwind/src/emcc.rs
index c6d42308596..af18e19337c 100644
--- a/library/panic_unwind/src/emcc.rs
+++ b/library/panic_unwind/src/emcc.rs
@@ -47,7 +47,7 @@ static EXCEPTION_TYPE_INFO: TypeInfo = TypeInfo {
     name: b"rust_panic\0".as_ptr(),
 };
 
-// NOTE(nbdd0121): The `canary` field will be part of stable ABI after `c_unwind` stabilization.
+// NOTE(nbdd0121): The `canary` field is part of stable ABI.
 #[repr(C)]
 struct Exception {
     // See `gcc.rs` on why this is present. We already have a static here so just use it.
diff --git a/library/panic_unwind/src/gcc.rs b/library/panic_unwind/src/gcc.rs
index 0b7a873a691..08858dd92be 100644
--- a/library/panic_unwind/src/gcc.rs
+++ b/library/panic_unwind/src/gcc.rs
@@ -48,8 +48,8 @@ use unwind as uw;
 static CANARY: u8 = 0;
 
 // NOTE(nbdd0121)
-// Once `c_unwind` feature is stabilized, there will be ABI stability requirement
-// on this struct. The first two field must be `_Unwind_Exception` and `canary`,
+// There is an ABI stability requirement on this struct.
+// The first two field must be `_Unwind_Exception` and `canary`,
 // as it may be accessed by a different version of the std with a different compiler.
 #[repr(C)]
 struct Exception {
diff --git a/library/panic_unwind/src/seh.rs b/library/panic_unwind/src/seh.rs
index 651115a8248..99db00e5490 100644
--- a/library/panic_unwind/src/seh.rs
+++ b/library/panic_unwind/src/seh.rs
@@ -52,7 +52,7 @@ use core::mem::{self, ManuallyDrop};
 use core::ptr;
 use libc::{c_int, c_uint, c_void};
 
-// NOTE(nbdd0121): The `canary` field will be part of stable ABI after `c_unwind` stabilization.
+// NOTE(nbdd0121): The `canary` field is part of stable ABI.
 #[repr(C)]
 struct Exception {
     // See `gcc.rs` on why this is present. We already have a static here so just use it.
diff --git a/tests/run-make/c-unwind-abi-catch-lib-panic/main.rs b/tests/run-make/c-unwind-abi-catch-lib-panic/main.rs
index 78a71219c78..42d3efa82d6 100644
--- a/tests/run-make/c-unwind-abi-catch-lib-panic/main.rs
+++ b/tests/run-make/c-unwind-abi-catch-lib-panic/main.rs
@@ -2,7 +2,6 @@
 //!
 //! This test triggers a panic in a Rust library that our foreign function invokes. This shows
 //! that we can unwind through the C code in that library, and catch the underlying panic.
-#![feature(c_unwind)]
 
 use std::panic::{catch_unwind, AssertUnwindSafe};
 
diff --git a/tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs b/tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs
index a99a04d5c6f..9e7bc3e53a1 100644
--- a/tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs
+++ b/tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs
@@ -1,5 +1,4 @@
 #![crate_type = "staticlib"]
-#![feature(c_unwind)]
 
 /// This function will panic if `x` is greater than 10.
 ///
diff --git a/tests/run-make/c-unwind-abi-catch-panic/main.rs b/tests/run-make/c-unwind-abi-catch-panic/main.rs
index 15d38d72160..1903be9561c 100644
--- a/tests/run-make/c-unwind-abi-catch-panic/main.rs
+++ b/tests/run-make/c-unwind-abi-catch-panic/main.rs
@@ -1,7 +1,6 @@
 //! A test for calling `C-unwind` functions across foreign function boundaries.
 //!
 //! This test triggers a panic when calling a foreign function that calls *back* into Rust.
-#![feature(c_unwind)]
 
 use std::panic::{catch_unwind, AssertUnwindSafe};
 
diff --git a/tests/run-make/foreign-double-unwind/foo.rs b/tests/run-make/foreign-double-unwind/foo.rs
index cae8aa9402d..c085480b4f8 100644
--- a/tests/run-make/foreign-double-unwind/foo.rs
+++ b/tests/run-make/foreign-double-unwind/foo.rs
@@ -1,8 +1,6 @@
 // Tests that C++ double unwinding through Rust code will be properly guarded
 // against instead of exhibiting undefined behaviour.
 
-#![feature(c_unwind)]
-
 extern "C-unwind" {
     fn throw_cxx_exception();
     fn cxx_catch_callback(cb: extern "C-unwind" fn());
diff --git a/tests/run-make/foreign-exceptions/foo.rs b/tests/run-make/foreign-exceptions/foo.rs
index dd3b7c76f28..ccf858d8587 100644
--- a/tests/run-make/foreign-exceptions/foo.rs
+++ b/tests/run-make/foreign-exceptions/foo.rs
@@ -2,8 +2,6 @@
 // are caught by catch_unwind. Also tests that Rust panics can unwind through
 // C++ code.
 
-#![feature(c_unwind)]
-
 use std::panic::{catch_unwind, AssertUnwindSafe};
 
 struct DropCheck<'a>(&'a mut bool);
diff --git a/tests/run-make/foreign-rust-exceptions/bar.rs b/tests/run-make/foreign-rust-exceptions/bar.rs
index 5f9efe32360..1d865b429fa 100644
--- a/tests/run-make/foreign-rust-exceptions/bar.rs
+++ b/tests/run-make/foreign-rust-exceptions/bar.rs
@@ -1,5 +1,4 @@
 #![crate_type = "cdylib"]
-#![feature(c_unwind)]
 
 #[no_mangle]
 extern "C-unwind" fn panic() {
diff --git a/tests/run-make/foreign-rust-exceptions/foo.rs b/tests/run-make/foreign-rust-exceptions/foo.rs
index 266987c5b6d..38942c55b19 100644
--- a/tests/run-make/foreign-rust-exceptions/foo.rs
+++ b/tests/run-make/foreign-rust-exceptions/foo.rs
@@ -1,5 +1,3 @@
-#![feature(c_unwind)]
-
 #[cfg_attr(not(windows), link(name = "bar"))]
 #[cfg_attr(windows, link(name = "bar.dll"))]
 extern "C-unwind" {
diff --git a/tests/rustdoc-json/fn_pointer/abi.rs b/tests/rustdoc-json/fn_pointer/abi.rs
index 3c1a453d12d..6a30acc2cc3 100644
--- a/tests/rustdoc-json/fn_pointer/abi.rs
+++ b/tests/rustdoc-json/fn_pointer/abi.rs
@@ -1,7 +1,6 @@
 // ignore-tidy-linelength
 
 #![feature(abi_vectorcall)]
-#![feature(c_unwind)]
 
 // @is "$.index[*][?(@.name=='AbiRust')].inner.type.inner.header.abi" \"Rust\"
 pub type AbiRust = fn();
diff --git a/tests/rustdoc-json/fns/abi.rs b/tests/rustdoc-json/fns/abi.rs
index 0e8b78bc0e6..7a5dbee730c 100644
--- a/tests/rustdoc-json/fns/abi.rs
+++ b/tests/rustdoc-json/fns/abi.rs
@@ -1,7 +1,6 @@
 // ignore-tidy-linelength
 
 #![feature(abi_vectorcall)]
-#![feature(c_unwind)]
 
 // @is "$.index[*][?(@.name=='abi_rust')].inner.header.abi" \"Rust\"
 pub fn abi_rust() {}
diff --git a/tests/rustdoc-json/methods/abi.rs b/tests/rustdoc-json/methods/abi.rs
index 4c97d97ceba..fd03d92d65b 100644
--- a/tests/rustdoc-json/methods/abi.rs
+++ b/tests/rustdoc-json/methods/abi.rs
@@ -1,7 +1,6 @@
 // ignore-tidy-linelength
 
 #![feature(abi_vectorcall)]
-#![feature(c_unwind)]
 #![feature(no_core)]
 #![no_core]
 
diff --git a/tests/ui/unwind-abis/feature-gate-thiscall-unwind.rs b/tests/ui/feature-gates/feature-gate-thiscall.rs
index 0a323e50fcf..97a732bcff7 100644
--- a/tests/ui/unwind-abis/feature-gate-thiscall-unwind.rs
+++ b/tests/ui/feature-gates/feature-gate-thiscall.rs
@@ -1,5 +1,4 @@
 // gate-test-abi_thiscall
-// gate-test-c_unwind
 // needs-llvm-components: x86
 // compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib
 #![no_core]
@@ -7,8 +6,8 @@
 #[lang="sized"]
 trait Sized { }
 
-// Test that the "thiscall-unwind" ABI is feature-gated, and cannot be used when
-// the `c_unwind` feature gate is not used.
+// Test that the "thiscall" ABI is feature-gated, and cannot be used when
+// the `abi_thiscall` feature gate is not used.
 
 extern "thiscall-unwind" fn fu() {} //~ ERROR thiscall-unwind ABI is experimental
 extern "thiscall" fn f() {} //~ ERROR thiscall is experimental
diff --git a/tests/ui/unwind-abis/feature-gate-thiscall-unwind.stderr b/tests/ui/feature-gates/feature-gate-thiscall.stderr
index 9ca00a55cd8..346e45952cd 100644
--- a/tests/ui/unwind-abis/feature-gate-thiscall-unwind.stderr
+++ b/tests/ui/feature-gates/feature-gate-thiscall.stderr
@@ -1,14 +1,13 @@
 error[E0658]: thiscall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:13:8
+  --> $DIR/feature-gate-thiscall.rs:12:8
    |
 LL | extern "thiscall-unwind" fn fu() {}
    |        ^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
+   = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:14:8
+  --> $DIR/feature-gate-thiscall.rs:13:8
    |
 LL | extern "thiscall" fn f() {}
    |        ^^^^^^^^^^
@@ -16,7 +15,7 @@ LL | extern "thiscall" fn f() {}
    = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:17:12
+  --> $DIR/feature-gate-thiscall.rs:16:12
    |
 LL |     extern "thiscall" fn m();
    |            ^^^^^^^^^^
@@ -24,16 +23,15 @@ LL |     extern "thiscall" fn m();
    = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:18:12
+  --> $DIR/feature-gate-thiscall.rs:17:12
    |
 LL |     extern "thiscall-unwind" fn mu();
    |            ^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
+   = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:20:12
+  --> $DIR/feature-gate-thiscall.rs:19:12
    |
 LL |     extern "thiscall" fn dm() {}
    |            ^^^^^^^^^^
@@ -41,16 +39,15 @@ LL |     extern "thiscall" fn dm() {}
    = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:21:12
+  --> $DIR/feature-gate-thiscall.rs:20:12
    |
 LL |     extern "thiscall-unwind" fn dmu() {}
    |            ^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
+   = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:26:12
+  --> $DIR/feature-gate-thiscall.rs:25:12
    |
 LL |     extern "thiscall" fn m() {}
    |            ^^^^^^^^^^
@@ -58,16 +55,15 @@ LL |     extern "thiscall" fn m() {}
    = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:27:12
+  --> $DIR/feature-gate-thiscall.rs:26:12
    |
 LL |     extern "thiscall-unwind" fn mu() {}
    |            ^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
+   = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:31:12
+  --> $DIR/feature-gate-thiscall.rs:30:12
    |
 LL |     extern "thiscall" fn im() {}
    |            ^^^^^^^^^^
@@ -75,16 +71,15 @@ LL |     extern "thiscall" fn im() {}
    = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:32:12
+  --> $DIR/feature-gate-thiscall.rs:31:12
    |
 LL |     extern "thiscall-unwind" fn imu() {}
    |            ^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
+   = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:35:18
+  --> $DIR/feature-gate-thiscall.rs:34:18
    |
 LL | type TA = extern "thiscall" fn();
    |                  ^^^^^^^^^^
@@ -92,16 +87,15 @@ LL | type TA = extern "thiscall" fn();
    = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:36:19
+  --> $DIR/feature-gate-thiscall.rs:35:19
    |
 LL | type TAU = extern "thiscall-unwind" fn();
    |                   ^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
+   = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:38:8
+  --> $DIR/feature-gate-thiscall.rs:37:8
    |
 LL | extern "thiscall" {}
    |        ^^^^^^^^^^
@@ -109,13 +103,12 @@ LL | extern "thiscall" {}
    = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error[E0658]: thiscall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-thiscall-unwind.rs:39:8
+  --> $DIR/feature-gate-thiscall.rs:38:8
    |
 LL | extern "thiscall-unwind" {}
    |        ^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
+   = help: add `#![feature(abi_thiscall)]` to the crate attributes to enable
 
 error: aborting due to 14 previous errors
 
diff --git a/tests/ui/feature-gates/feature-gate-vectorcall.rs b/tests/ui/feature-gates/feature-gate-vectorcall.rs
index 5a6c6d28804..706780dfd6c 100644
--- a/tests/ui/feature-gates/feature-gate-vectorcall.rs
+++ b/tests/ui/feature-gates/feature-gate-vectorcall.rs
@@ -6,8 +6,8 @@
 #[lang="sized"]
 trait Sized { }
 
-// Test that the "vectorcall-unwind" ABI is feature-gated, and cannot be used when
-// the `c_unwind` feature gate is not used.
+// Test that the "vectorcall" ABI is feature-gated, and cannot be used when
+// the `vectorcall` feature gate is not used.
 
 extern "vectorcall" fn f() {} //~ ERROR vectorcall is experimental
 
diff --git a/tests/ui/panic-runtime/auxiliary/needs-unwind.rs b/tests/ui/panic-runtime/auxiliary/needs-unwind.rs
index d555b531986..ba917b52d9a 100644
--- a/tests/ui/panic-runtime/auxiliary/needs-unwind.rs
+++ b/tests/ui/panic-runtime/auxiliary/needs-unwind.rs
@@ -3,7 +3,6 @@
 
 #![crate_type = "rlib"]
 #![no_std]
-#![feature(c_unwind)]
 
 extern "C-unwind" fn foo() {}
 
diff --git a/tests/ui/stability-attribute/stability-attribute-trait-impl.rs b/tests/ui/stability-attribute/stability-attribute-trait-impl.rs
index 0c771ae8795..1d138e26408 100644
--- a/tests/ui/stability-attribute/stability-attribute-trait-impl.rs
+++ b/tests/ui/stability-attribute/stability-attribute-trait-impl.rs
@@ -1,4 +1,4 @@
-#![feature(staged_api, never_type, c_unwind)]
+#![feature(staged_api, never_type, rust_cold_cc)]
 //~^ ERROR module has missing stability attribute
 
 #[stable(feature = "a", since = "1")]
@@ -25,9 +25,9 @@ impl UnstableTrait for StableType {}
 #[unstable(feature = "h", issue = "none")]
 impl StableTrait for ! {}
 
-// Note: If C-unwind is stabilized, switch this to another (unstable) ABI.
+// Note: If rust_cold_cc is stabilized, switch this to another (unstable) ABI.
 #[unstable(feature = "i", issue = "none")]
-impl StableTrait for extern "C-unwind" fn() {}
+impl StableTrait for extern "rust-cold" fn() {}
 
 #[unstable(feature = "j", issue = "none")]
 //~^ ERROR an `#[unstable]` annotation here has no effect [ineffective_unstable_trait_impl]
diff --git a/tests/ui/stability-attribute/stability-attribute-trait-impl.stderr b/tests/ui/stability-attribute/stability-attribute-trait-impl.stderr
index b91a1d2e11a..96322c2c945 100644
--- a/tests/ui/stability-attribute/stability-attribute-trait-impl.stderr
+++ b/tests/ui/stability-attribute/stability-attribute-trait-impl.stderr
@@ -18,7 +18,7 @@ LL | #[unstable(feature = "k", issue = "none")]
 error: module has missing stability attribute
   --> $DIR/stability-attribute-trait-impl.rs:1:1
    |
-LL | / #![feature(staged_api, never_type, c_unwind)]
+LL | / #![feature(staged_api, never_type, rust_cold_cc)]
 LL | |
 LL | |
 LL | | #[stable(feature = "a", since = "1")]
diff --git a/tests/ui/unwind-abis/feature-gate-c-unwind-enabled.rs b/tests/ui/unwind-abis/feature-gate-c-unwind-enabled.rs
deleted file mode 100644
index 6ff5dbda2d5..00000000000
--- a/tests/ui/unwind-abis/feature-gate-c-unwind-enabled.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// Test that the "C-unwind" ABI is feature-gated, and *can* be used when the
-// `c_unwind` feature gate is enabled.
-
-// check-pass
-
-#![feature(c_unwind)]
-
-extern "C-unwind" fn f() {}
-
-fn main() {
-    f();
-}
diff --git a/tests/ui/unwind-abis/feature-gate-c-unwind.rs b/tests/ui/unwind-abis/feature-gate-c-unwind.rs
deleted file mode 100644
index ba72f74f20c..00000000000
--- a/tests/ui/unwind-abis/feature-gate-c-unwind.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Test that the "C-unwind" ABI is feature-gated, and cannot be used when the
-// `c_unwind` feature gate is not used.
-
-#![allow(ffi_unwind_calls)]
-//~^ WARNING unknown lint: `ffi_unwind_calls`
-//~| WARNING unknown lint: `ffi_unwind_calls`
-
-extern "C-unwind" fn f() {}
-//~^ ERROR C-unwind ABI is experimental and subject to change [E0658]
-
-fn main() {
-    f();
-}
diff --git a/tests/ui/unwind-abis/feature-gate-c-unwind.stderr b/tests/ui/unwind-abis/feature-gate-c-unwind.stderr
deleted file mode 100644
index 214ddc45ce9..00000000000
--- a/tests/ui/unwind-abis/feature-gate-c-unwind.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-warning: unknown lint: `ffi_unwind_calls`
-  --> $DIR/feature-gate-c-unwind.rs:4:1
-   |
-LL | #![allow(ffi_unwind_calls)]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: the `ffi_unwind_calls` lint is unstable
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-   = note: `#[warn(unknown_lints)]` on by default
-
-error[E0658]: C-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-c-unwind.rs:8:8
-   |
-LL | extern "C-unwind" fn f() {}
-   |        ^^^^^^^^^^
-   |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-warning: unknown lint: `ffi_unwind_calls`
-  --> $DIR/feature-gate-c-unwind.rs:4:1
-   |
-LL | #![allow(ffi_unwind_calls)]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: the `ffi_unwind_calls` lint is unstable
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-error: aborting due to previous error; 2 warnings emitted
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/unwind-abis/feature-gate-c_unwind.rs b/tests/ui/unwind-abis/feature-gate-c_unwind.rs
new file mode 100644
index 00000000000..d73fe3e0bda
--- /dev/null
+++ b/tests/ui/unwind-abis/feature-gate-c_unwind.rs
@@ -0,0 +1,4 @@
+// ignore-test
+
+// After partial stabilisation, `c_unwind` only contains codegen behaviour changes
+// and are tested in `src/test/codegen/unwind-abis`
diff --git a/tests/ui/unwind-abis/feature-gate-stdcall-unwind.rs b/tests/ui/unwind-abis/feature-gate-stdcall-unwind.rs
deleted file mode 100644
index cfa8eb3cad0..00000000000
--- a/tests/ui/unwind-abis/feature-gate-stdcall-unwind.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// gate-test-c_unwind
-// needs-llvm-components: x86
-// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib
-#![no_core]
-#![feature(no_core, lang_items)]
-#[lang="sized"]
-trait Sized { }
-
-// Test that the "stdcall-unwind" ABI is feature-gated, and cannot be used when
-// the `c_unwind` feature gate is not used.
-
-extern "stdcall-unwind" fn fu() {} //~ ERROR stdcall-unwind ABI is experimental
-
-trait T {
-    extern "stdcall-unwind" fn mu(); //~ ERROR stdcall-unwind ABI is experimental
-    extern "stdcall-unwind" fn dmu() {} //~ ERROR stdcall-unwind ABI is experimental
-}
-
-struct S;
-impl T for S {
-    extern "stdcall-unwind" fn mu() {} //~ ERROR stdcall-unwind ABI is experimental
-}
-
-impl S {
-    extern "stdcall-unwind" fn imu() {} //~ ERROR stdcall-unwind ABI is experimental
-}
-
-type TAU = extern "stdcall-unwind" fn(); //~ ERROR stdcall-unwind ABI is experimental
-
-extern "stdcall-unwind" {} //~ ERROR stdcall-unwind ABI is experimental
diff --git a/tests/ui/unwind-abis/feature-gate-stdcall-unwind.stderr b/tests/ui/unwind-abis/feature-gate-stdcall-unwind.stderr
deleted file mode 100644
index c2cce0e1193..00000000000
--- a/tests/ui/unwind-abis/feature-gate-stdcall-unwind.stderr
+++ /dev/null
@@ -1,66 +0,0 @@
-error[E0658]: stdcall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-stdcall-unwind.rs:12:8
-   |
-LL | extern "stdcall-unwind" fn fu() {}
-   |        ^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-error[E0658]: stdcall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-stdcall-unwind.rs:15:12
-   |
-LL |     extern "stdcall-unwind" fn mu();
-   |            ^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-error[E0658]: stdcall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-stdcall-unwind.rs:16:12
-   |
-LL |     extern "stdcall-unwind" fn dmu() {}
-   |            ^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-error[E0658]: stdcall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-stdcall-unwind.rs:21:12
-   |
-LL |     extern "stdcall-unwind" fn mu() {}
-   |            ^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-error[E0658]: stdcall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-stdcall-unwind.rs:25:12
-   |
-LL |     extern "stdcall-unwind" fn imu() {}
-   |            ^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-error[E0658]: stdcall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-stdcall-unwind.rs:28:19
-   |
-LL | type TAU = extern "stdcall-unwind" fn();
-   |                   ^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-error[E0658]: stdcall-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-stdcall-unwind.rs:30:8
-   |
-LL | extern "stdcall-unwind" {}
-   |        ^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-error: aborting due to 7 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/unwind-abis/feature-gate-system-unwind.rs b/tests/ui/unwind-abis/feature-gate-system-unwind.rs
deleted file mode 100644
index 26c2de4e817..00000000000
--- a/tests/ui/unwind-abis/feature-gate-system-unwind.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// Test that the "system-unwind" ABI is feature-gated, and cannot be used when
-// the `c_unwind` feature gate is not used.
-
-extern "system-unwind" fn f() {}
-//~^ ERROR system-unwind ABI is experimental and subject to change [E0658]
-
-fn main() {
-    f();
-}
diff --git a/tests/ui/unwind-abis/feature-gate-system-unwind.stderr b/tests/ui/unwind-abis/feature-gate-system-unwind.stderr
deleted file mode 100644
index 87877336475..00000000000
--- a/tests/ui/unwind-abis/feature-gate-system-unwind.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: system-unwind ABI is experimental and subject to change
-  --> $DIR/feature-gate-system-unwind.rs:4:8
-   |
-LL | extern "system-unwind" fn f() {}
-   |        ^^^^^^^^^^^^^^^
-   |
-   = note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
-   = help: add `#![feature(c_unwind)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/unwind-abis/ffi-unwind-calls-lint.rs b/tests/ui/unwind-abis/ffi-unwind-calls-lint.rs
index 9a324f00435..8f000737656 100644
--- a/tests/ui/unwind-abis/ffi-unwind-calls-lint.rs
+++ b/tests/ui/unwind-abis/ffi-unwind-calls-lint.rs
@@ -1,7 +1,6 @@
 // build-pass
 // needs-unwind
 
-#![feature(c_unwind)]
 #![warn(ffi_unwind_calls)]
 
 mod foo {
diff --git a/tests/ui/unwind-abis/ffi-unwind-calls-lint.stderr b/tests/ui/unwind-abis/ffi-unwind-calls-lint.stderr
index 937a2b3dff8..cf8a7782e35 100644
--- a/tests/ui/unwind-abis/ffi-unwind-calls-lint.stderr
+++ b/tests/ui/unwind-abis/ffi-unwind-calls-lint.stderr
@@ -1,17 +1,17 @@
 warning: call to foreign function with FFI-unwind ABI
-  --> $DIR/ffi-unwind-calls-lint.rs:20:14
+  --> $DIR/ffi-unwind-calls-lint.rs:19:14
    |
 LL |     unsafe { foo(); }
    |              ^^^^^ call to foreign function with FFI-unwind ABI
    |
 note: the lint level is defined here
-  --> $DIR/ffi-unwind-calls-lint.rs:5:9
+  --> $DIR/ffi-unwind-calls-lint.rs:4:9
    |
 LL | #![warn(ffi_unwind_calls)]
    |         ^^^^^^^^^^^^^^^^
 
 warning: call to function pointer with FFI-unwind ABI
-  --> $DIR/ffi-unwind-calls-lint.rs:24:5
+  --> $DIR/ffi-unwind-calls-lint.rs:23:5
    |
 LL |     ptr();
    |     ^^^^^ call to function pointer with FFI-unwind ABI