Uh oh!
There was an error while loading. Please reload this page.
Fix our llvm::Bool typedef to be signed, to match LLVMBool - #134204
Conversation
In the LLVM-C API, boolean values are passed as `typedef int LLVMBool`, but our Rust-side typedef was using `c_uint` instead. Signed and unsigned integers have the same ABI on most platforms, but that isn't universally true, so we should prefer to be consistent with LLVM.
rustbot
commented
Dec 12, 2024
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
SparrowLii
commented
Dec 12, 2024
Thanks, that makes sense! Please r=me if CI looks good |
Zalathar
commented
Dec 12, 2024
I looked into the history and it turns out this mistake was introduced in ... 2012. I guess nobody noticed in all this time because it doesn't matter much on any host platform where signed and unsigned integers have the same ABI, which is the overwhelmingly common case. Even I only noticed because I was double-checking a comment that I was writing. |
workingjubilee
commented
Dec 12, 2024
@bors r=SparrowLii |
bors
commented
Dec 12, 2024
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#133122 (Add unpolished, experimental support for AFIDT (async fn in dyn trait)) - rust-lang#133249 (ABI checks: add support for loongarch) - rust-lang#134089 (Use newly added exceptions to non default branch warning) - rust-lang#134188 (Bump Fuchsia) - rust-lang#134204 (Fix our `llvm::Bool` typedef to be signed, to match `LLVMBool`) - rust-lang#134207 (Revert "bootstrap: print{ln}! -> eprint{ln}! (take 2) rust-lang#134040") - rust-lang#134214 (rustdoc: fix self cmp) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#134204 - Zalathar:llvm-bool, r=SparrowLii Fix our `llvm::Bool` typedef to be signed, to match `LLVMBool` In the LLVM-C API, boolean values are passed as `typedef int LLVMBool`, but our Rust-side typedef was using `c_uint` instead. Signed and unsigned integers have the same ABI on most platforms, but that isn't universally true, so we should prefer to be consistent with LLVM. https://github.com/rust-lang/llvm-project/blob/1268e87/llvm/include/llvm-c/Types.h#L28
In the LLVM-C API, boolean values are passed as
typedef int LLVMBool, but our Rust-side typedef was usingc_uintinstead.Signed and unsigned integers have the same ABI on most platforms, but that isn't universally true, so we should prefer to be consistent with LLVM.
https://github.com/rust-lang/llvm-project/blob/1268e87/llvm/include/llvm-c/Types.h#L28