Skip to content

Commit 723aee2

Browse files
committedApr 29, 2023
Partial stabilisation of c_unwind
1 parent f229949 commit 723aee2

File tree

6 files changed

+11
-43
lines changed

6 files changed

+11
-43
lines changed
 

‎compiler/rustc_feature/src/active.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ declare_features! (
311311
(active, async_closure, "1.37.0", Some(62290), None),
312312
/// Allows async functions to be declared, implemented, and used in traits.
313313
(incomplete, async_fn_in_trait, "1.66.0", Some(91611), None),
314-
/// Allows `extern "C-unwind" fn` to enable unwinding across ABI boundaries.
314+
/// Treat `extern "C"` function as nounwind.
315315
(active, c_unwind, "1.52.0", Some(74990), None),
316316
/// Allows using C-variadics.
317317
(active, c_variadic, "1.34.0", Some(44930), None),

‎compiler/rustc_lint_defs/src/builtin.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -4014,7 +4014,6 @@ declare_lint! {
40144014
/// ### Example
40154015
///
40164016
/// ```rust
4017-
/// #![feature(c_unwind)]
40184017
/// #![warn(ffi_unwind_calls)]
40194018
///
40204019
/// extern "C-unwind" {
@@ -4037,8 +4036,7 @@ declare_lint! {
40374036
/// that desire this ability it is therefore necessary to avoid such calls.
40384037
pub FFI_UNWIND_CALLS,
40394038
Allow,
4040-
"call to foreign functions or function pointers with FFI-unwind ABI",
4041-
@feature_gate = sym::c_unwind;
4039+
"call to foreign functions or function pointers with FFI-unwind ABI"
40424040
}
40434041

40444042
declare_lint! {

‎compiler/rustc_target/src/spec/abi.rs

+5-35
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
149149
match name {
150150
// Stable
151151
"Rust" | "C" | "cdecl" | "stdcall" | "fastcall" | "aapcs" | "win64" | "sysv64"
152-
| "system" | "efiapi" => Ok(()),
152+
| "system" | "efiapi" | "C-unwind" | "cdecl-unwind" | "stdcall-unwind"
153+
| "fastcall-unwind" | "aapcs-unwind" | "win64-unwind" | "sysv64-unwind"
154+
| "system-unwind" => Ok(()),
153155
"rust-intrinsic" => Err(AbiDisabled::Unstable {
154156
feature: sym::intrinsics,
155157
explain: "intrinsics are subject to change",
@@ -202,46 +204,14 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
202204
feature: sym::abi_c_cmse_nonsecure_call,
203205
explain: "C-cmse-nonsecure-call ABI is experimental and subject to change",
204206
}),
205-
"C-unwind" => Err(AbiDisabled::Unstable {
206-
feature: sym::c_unwind,
207-
explain: "C-unwind ABI is experimental and subject to change",
208-
}),
209-
"stdcall-unwind" => Err(AbiDisabled::Unstable {
210-
feature: sym::c_unwind,
211-
explain: "stdcall-unwind ABI is experimental and subject to change",
212-
}),
213-
"system-unwind" => Err(AbiDisabled::Unstable {
214-
feature: sym::c_unwind,
215-
explain: "system-unwind ABI is experimental and subject to change",
216-
}),
217207
"thiscall-unwind" => Err(AbiDisabled::Unstable {
218-
feature: sym::c_unwind,
208+
feature: sym::abi_thiscall,
219209
explain: "thiscall-unwind ABI is experimental and subject to change",
220210
}),
221-
"cdecl-unwind" => Err(AbiDisabled::Unstable {
222-
feature: sym::c_unwind,
223-
explain: "cdecl-unwind ABI is experimental and subject to change",
224-
}),
225-
"fastcall-unwind" => Err(AbiDisabled::Unstable {
226-
feature: sym::c_unwind,
227-
explain: "fastcall-unwind ABI is experimental and subject to change",
228-
}),
229211
"vectorcall-unwind" => Err(AbiDisabled::Unstable {
230-
feature: sym::c_unwind,
212+
feature: sym::abi_vectorcall,
231213
explain: "vectorcall-unwind ABI is experimental and subject to change",
232214
}),
233-
"aapcs-unwind" => Err(AbiDisabled::Unstable {
234-
feature: sym::c_unwind,
235-
explain: "aapcs-unwind ABI is experimental and subject to change",
236-
}),
237-
"win64-unwind" => Err(AbiDisabled::Unstable {
238-
feature: sym::c_unwind,
239-
explain: "win64-unwind ABI is experimental and subject to change",
240-
}),
241-
"sysv64-unwind" => Err(AbiDisabled::Unstable {
242-
feature: sym::c_unwind,
243-
explain: "sysv64-unwind ABI is experimental and subject to change",
244-
}),
245215
"wasm" => Err(AbiDisabled::Unstable {
246216
feature: sym::wasm_abi,
247217
explain: "wasm ABI is experimental and subject to change",

‎library/panic_unwind/src/emcc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static EXCEPTION_TYPE_INFO: TypeInfo = TypeInfo {
4747
name: b"rust_panic\0".as_ptr(),
4848
};
4949

50-
// NOTE(nbdd0121): The `canary` field will be part of stable ABI after `c_unwind` stabilization.
50+
// NOTE(nbdd0121): The `canary` field is part of stable ABI.
5151
#[repr(C)]
5252
struct Exception {
5353
// See `gcc.rs` on why this is present. We already have a static here so just use it.

‎library/panic_unwind/src/gcc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ use unwind as uw;
4848
static CANARY: u8 = 0;
4949

5050
// NOTE(nbdd0121)
51-
// Once `c_unwind` feature is stabilized, there will be ABI stability requirement
52-
// on this struct. The first two field must be `_Unwind_Exception` and `canary`,
51+
// There is an ABI stability requirement on this struct.
52+
// The first two field must be `_Unwind_Exception` and `canary`,
5353
// as it may be accessed by a different version of the std with a different compiler.
5454
#[repr(C)]
5555
struct Exception {

‎library/panic_unwind/src/seh.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use core::mem::{self, ManuallyDrop};
5252
use core::ptr;
5353
use libc::{c_int, c_uint, c_void};
5454

55-
// NOTE(nbdd0121): The `canary` field will be part of stable ABI after `c_unwind` stabilization.
55+
// NOTE(nbdd0121): The `canary` field is part of stable ABI.
5656
#[repr(C)]
5757
struct Exception {
5858
// See `gcc.rs` on why this is present. We already have a static here so just use it.

0 commit comments

Comments
 (0)