-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
Thanks, that makes sense! Please r=me if CI looks good |
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. |
@bors r=SparrowLii |
…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_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