From d60c6c31fee1b6c50f5b7ec5dcdceeae491a8cf7 Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Sat, 15 Aug 2026 16:58:18 +0000 Subject: [PATCH] bun:ffi: remove ABIType::param_typename, a copy of ABIType::typename Both wrote typename_label() to the writer. The parameter and return positions of the generated prototype have always used the same C type name, so print_source_code now calls typename for both and the reimplemented_helper baseline entry for abi_type.rs goes away. --- mordant-baseline.toml | 1 - src/runtime/ffi/abi_type.rs | 11 +---------- src/runtime/ffi/ffi_body.rs | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/mordant-baseline.toml b/mordant-baseline.toml index 109483f7b029..fddc96426ab9 100644 --- a/mordant-baseline.toml +++ b/mordant-baseline.toml @@ -73,7 +73,6 @@ "parallel_vecs:src/runtime/api/html_rewriter.rs" = 1 "parallel_vecs:src/runtime/bake/dev_server/incremental_graph.rs" = 1 "reimplemented_helper:src/runtime/api/bun/Terminal.rs" = 1 -"reimplemented_helper:src/runtime/ffi/abi_type.rs" = 1 "reimplemented_helper:src/runtime/hw_exports.rs" = 1 "same_match_twice:src/runtime/api/YAMLObject.rs" = 1 "same_match_twice:src/runtime/api/bun/h2_frame_parser.rs" = 1 diff --git a/src/runtime/ffi/abi_type.rs b/src/runtime/ffi/abi_type.rs index 32dc51c65896..dec1591b6faf 100644 --- a/src/runtime/ffi/abi_type.rs +++ b/src/runtime/ffi/abi_type.rs @@ -102,8 +102,7 @@ bun_core::comptime_string_map! { } // ───────────────────────────────────────────────────────────────────────────── -// Per-variant string table — single source of truth for the four exhaustive -// matches that previously lived in typename_label / param_typename_label / +// Per-variant string table — single source of truth for typename_label / // ToCFormatter / ToJSFormatter. Indexed by `self as usize`. // ───────────────────────────────────────────────────────────────────────────── @@ -225,14 +224,6 @@ impl ABIType { pub(crate) fn typename_label(self) -> &'static [u8] { self.row().c_type } - - pub(crate) fn param_typename( - self, - writer: &mut impl std::io::Write, - ) -> Result<(), crate::Error> { - writer.write_all(self.typename_label())?; - Ok(()) - } } pub struct ToCFormatter<'a> { diff --git a/src/runtime/ffi/ffi_body.rs b/src/runtime/ffi/ffi_body.rs index e64f2e8830f4..1a24b794c0b4 100644 --- a/src/runtime/ffi/ffi_body.rs +++ b/src/runtime/ffi/ffi_body.rs @@ -2135,7 +2135,7 @@ impl Function { writer.write_all(b", ")?; } first = false; - arg.param_typename(writer)?; + arg.typename(writer)?; write!(writer, " arg{}", i)?; } writer.write_all(