From 515053ea59616e727ec486da989d3070006b2e87 Mon Sep 17 00:00:00 2001 From: Eric Saxby <77073+sax@users.noreply.github.com> Date: Wed, 7 Oct 2026 12:01:44 -0700 Subject: [PATCH] Fix rust build on arm64 Linux, where C char is unsigned Options#build_options cast each scope local's pointer to `*const i8` before passing it to pm_string_constant_init. bindgen generates the parameter as `*const c_char`, which is `i8` on x86 Linux, macOS and Windows but `u8` on Linux ARM, so the crate failed to compile there: error[E0308]: mismatched types --> ruby-prism/src/lib.rs:306:64 expected `*const u8`, found `*const i8` Use `.cast()` and let the type be inferred from the bindings instead. CI only builds on platforms where char is signed, which is why this went unnoticed. --- rust/ruby-prism/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 6337957d20..3ae8e70437 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -303,7 +303,7 @@ impl Options { for (local_index, local) in scope.locals.iter().enumerate() { let pm_local = unsafe { pm_options_scope_local_mut(pm_scope, local_index) }; - unsafe { pm_string_constant_init(pm_local, local.as_ptr().cast::(), local.len()) }; + unsafe { pm_string_constant_init(pm_local, local.as_ptr().cast(), local.len()) }; } let forwarding = scope.forwarding.iter().fold(0u8, |acc, &flag| acc | u8::from(flag));