Partial stabilisation of c_unwind
This commit is contained in:
parent
f2299490c1
commit
723aee2e56
6 changed files with 11 additions and 43 deletions
|
@ -311,7 +311,7 @@ declare_features! (
|
||||||
(active, async_closure, "1.37.0", Some(62290), None),
|
(active, async_closure, "1.37.0", Some(62290), None),
|
||||||
/// Allows async functions to be declared, implemented, and used in traits.
|
/// Allows async functions to be declared, implemented, and used in traits.
|
||||||
(incomplete, async_fn_in_trait, "1.66.0", Some(91611), None),
|
(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),
|
(active, c_unwind, "1.52.0", Some(74990), None),
|
||||||
/// Allows using C-variadics.
|
/// Allows using C-variadics.
|
||||||
(active, c_variadic, "1.34.0", Some(44930), None),
|
(active, c_variadic, "1.34.0", Some(44930), None),
|
||||||
|
|
|
@ -4014,7 +4014,6 @@ declare_lint! {
|
||||||
/// ### Example
|
/// ### Example
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// #![feature(c_unwind)]
|
|
||||||
/// #![warn(ffi_unwind_calls)]
|
/// #![warn(ffi_unwind_calls)]
|
||||||
///
|
///
|
||||||
/// extern "C-unwind" {
|
/// extern "C-unwind" {
|
||||||
|
@ -4037,8 +4036,7 @@ declare_lint! {
|
||||||
/// that desire this ability it is therefore necessary to avoid such calls.
|
/// that desire this ability it is therefore necessary to avoid such calls.
|
||||||
pub FFI_UNWIND_CALLS,
|
pub FFI_UNWIND_CALLS,
|
||||||
Allow,
|
Allow,
|
||||||
"call to foreign functions or function pointers with FFI-unwind ABI",
|
"call to foreign functions or function pointers with FFI-unwind ABI"
|
||||||
@feature_gate = sym::c_unwind;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare_lint! {
|
declare_lint! {
|
||||||
|
|
|
@ -149,7 +149,9 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
|
||||||
match name {
|
match name {
|
||||||
// Stable
|
// Stable
|
||||||
"Rust" | "C" | "cdecl" | "stdcall" | "fastcall" | "aapcs" | "win64" | "sysv64"
|
"Rust" | "C" | "cdecl" | "stdcall" | "fastcall" | "aapcs" | "win64" | "sysv64"
|
||||||
| "system" | "efiapi" => Ok(()),
|
| "system" | "efiapi" | "C-unwind" | "cdecl-unwind" | "stdcall-unwind"
|
||||||
|
| "fastcall-unwind" | "aapcs-unwind" | "win64-unwind" | "sysv64-unwind"
|
||||||
|
| "system-unwind" => Ok(()),
|
||||||
"rust-intrinsic" => Err(AbiDisabled::Unstable {
|
"rust-intrinsic" => Err(AbiDisabled::Unstable {
|
||||||
feature: sym::intrinsics,
|
feature: sym::intrinsics,
|
||||||
explain: "intrinsics are subject to change",
|
explain: "intrinsics are subject to change",
|
||||||
|
@ -202,46 +204,14 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
|
||||||
feature: sym::abi_c_cmse_nonsecure_call,
|
feature: sym::abi_c_cmse_nonsecure_call,
|
||||||
explain: "C-cmse-nonsecure-call ABI is experimental and subject to change",
|
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 {
|
"thiscall-unwind" => Err(AbiDisabled::Unstable {
|
||||||
feature: sym::c_unwind,
|
feature: sym::abi_thiscall,
|
||||||
explain: "thiscall-unwind ABI is experimental and subject to change",
|
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 {
|
"vectorcall-unwind" => Err(AbiDisabled::Unstable {
|
||||||
feature: sym::c_unwind,
|
feature: sym::abi_vectorcall,
|
||||||
explain: "vectorcall-unwind ABI is experimental and subject to change",
|
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 {
|
"wasm" => Err(AbiDisabled::Unstable {
|
||||||
feature: sym::wasm_abi,
|
feature: sym::wasm_abi,
|
||||||
explain: "wasm ABI is experimental and subject to change",
|
explain: "wasm ABI is experimental and subject to change",
|
||||||
|
|
|
@ -47,7 +47,7 @@ static EXCEPTION_TYPE_INFO: TypeInfo = TypeInfo {
|
||||||
name: b"rust_panic\0".as_ptr(),
|
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)]
|
#[repr(C)]
|
||||||
struct Exception {
|
struct Exception {
|
||||||
// See `gcc.rs` on why this is present. We already have a static here so just use it.
|
// See `gcc.rs` on why this is present. We already have a static here so just use it.
|
||||||
|
|
|
@ -48,8 +48,8 @@ use unwind as uw;
|
||||||
static CANARY: u8 = 0;
|
static CANARY: u8 = 0;
|
||||||
|
|
||||||
// NOTE(nbdd0121)
|
// NOTE(nbdd0121)
|
||||||
// Once `c_unwind` feature is stabilized, there will be ABI stability requirement
|
// There is an ABI stability requirement on this struct.
|
||||||
// on this struct. The first two field must be `_Unwind_Exception` and `canary`,
|
// 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.
|
// as it may be accessed by a different version of the std with a different compiler.
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct Exception {
|
struct Exception {
|
||||||
|
|
|
@ -52,7 +52,7 @@ use core::mem::{self, ManuallyDrop};
|
||||||
use core::ptr;
|
use core::ptr;
|
||||||
use libc::{c_int, c_uint, c_void};
|
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)]
|
#[repr(C)]
|
||||||
struct Exception {
|
struct Exception {
|
||||||
// See `gcc.rs` on why this is present. We already have a static here so just use it.
|
// See `gcc.rs` on why this is present. We already have a static here so just use it.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue