We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ExternAbi::is_rustic_abi
1 parent f9e0239 commit 1f32f7bCopy full SHA for 1f32f7b
compiler/rustc_abi/src/extern_abi.rs
@@ -191,6 +191,17 @@ impl StableOrd for ExternAbi {
191
}
192
193
impl ExternAbi {
194
+ /// An ABI "like Rust"
195
+ ///
196
+ /// These ABIs are fully controlled by the Rust compiler, which means they
197
+ /// - support unwinding with `-Cpanic=unwind`, unlike `extern "C"`
198
+ /// - often diverge from the C ABI
199
+ /// - are subject to change between compiler versions
200
+ pub fn is_rustic_abi(self) -> bool {
201
+ use ExternAbi::*;
202
+ matches!(self, Rust | RustCall | RustIntrinsic | RustCold)
203
+ }
204
+
205
pub fn supports_varargs(self) -> bool {
206
// * C and Cdecl obviously support varargs.
207
// * C can be based on Aapcs, SysV64 or Win64, so they must support varargs.
0 commit comments