-pub(crate) fn format_abi(abi: abi::Abi, explicit_abi: bool, is_mod: bool) -> Cow<'static, str> {
- if abi == abi::Abi::Rust && !is_mod {
+pub(crate) fn format_extern(
+ ext: ast::Extern,
+ explicit_abi: bool,
+ is_mod: bool,
+) -> Cow<'static, str> {
+ let abi = match ext {
+ ast::Extern::None => "Rust".to_owned(),
+ ast::Extern::Implicit => "C".to_owned(),
+ ast::Extern::Explicit(abi) => abi.symbol_unescaped.to_string(),
+ };
+
+ if abi == "Rust" && !is_mod {