chewing / libchewing

libchewing - The intelligent phonetic input method library
https://chewing.im/
GNU Lesser General Public License v2.1
357 stars 89 forks source link

FTBFS on aarch64 due to type mismatch: c_char may be i8 or u8 #534

Closed kanru closed 2 months ago

kanru commented 2 months ago

Describe the bug

A scratch build on Fedora failed on aarch64 https://kojipkgs.fedoraproject.org//work/tasks/2034/117682034/build.log

To Reproduce

Run cargo test -p chewing_capi on aarch64

error[E0308]: mismatched types
  --> capi/src/io.rs:92:81
   |
92 |         .and_then(|data| str::from_utf8(unsafe { mem::transmute::<&[i8], &[u8]>(data) }).ok())
   |                                                  ------------------------------ ^^^^ expected `&[i8]`, found `&[u8]`
   |                                                  |
   |                                                  arguments to this function are incorrect
   |
   = note: expected reference `&[i8]`
              found reference `&[u8]`
note: function defined here
  --> /builddir/build/BUILD/rustc-1.78.0-src/library/core/src/intrinsics.rs:1419:12
For more information about this error, try `rustc --explain E0308`.

Expected behavior

Test should pass

Platform (please complete the following information):

Additional context

https://github.com/rust-lang/rust/issues/79089