Implement Display for rustc_target::callconv::Conv by tiif · Pull Request #135808 · rust-lang/rust (original) (raw)

According to conv_from_spec_abi, the reverse mapping of Conv::Rust can potentially be ExternAbi::RustIntrinsic / RustCall / Rust. Similarly, Conv::C can be mapped to ExternAbi::C / Unadjusted / Cdecl.

Also, in adjust_abi, ExternAbi::StdCall / Thiscall / Fastcall / VectorCall can occasionally get mapped to ExternAbi::C. That means the reverse mapping of Conv::C to ExternAbican possibly be any of them.

If I ignore all of the issues above, the simplest reverse mapping that I can think of is:

But I am not sure if this is still correct, so cc @workingjubilee for a vibe check :)