It's a correctness issue for C++ too. It allows self-referential structs. Move constructors can be used to fix self-referential pointers, but Rust isn't going to call them.
I think fastcall
happens to be the same for C and C++ (fastcall
with attribute for non-trivial C++ types could be the C++ fastcall ABI).
But there is a general problem with lack of orthogonality/customizability in Rust's extern "ABI"
design. There's already "C"
and "C-unwind"
. Every other ABI will need an *-unwind
variant, and if C++ affects it, it would need *-C++
and *-C++-unwind
variants too.
There's also a gray area of target_feature
and avx2
in Rust, which is kinda like extern "Rust-avx2" fn()
for SIMD types.