Skip to content

Conversation

@pekkarr
Copy link
Contributor

@pekkarr pekkarr commented Nov 8, 2025

Don't require that the alignment of size_t equals pointer size when using the size_t_is_usize option. The purpose of this check was to make sure that size_t and uintptr_t are the same type, but the alignment and size don't have to match for that to be true. The code still checks that size_t has the same size as a pointer.

Clang's C API doesn't expose the target pointer alignment, so just remove the assert.

Fixes #3312

@emilio emilio enabled auto-merge November 8, 2025 20:34
@pekkarr
Copy link
Contributor Author

pekkarr commented Nov 8, 2025

Thanks a lot!

Should I rebase on main to trigger a new CI run? I think this is not getting into the merge queue because of the failed CI.

Don't require that the alignment of `size_t` equals pointer size when
using the `size_t_is_usize` option. The purpose of this check was to make
sure that `size_t` and `uintptr_t` are the same type, but the alignment
and size don't have to match for that to be true. The code still checks
that `size_t` has the same size as a pointer.

Clang's C API doesn't expose the target pointer alignment, so just remove
the assert.

Fixes rust-lang#3312
@emilio
Copy link
Contributor

emilio commented Nov 9, 2025

I think it should work now. Thanks for the patch and the extra clippy fixes!

@emilio emilio added this pull request to the merge queue Nov 9, 2025
Merged via the queue into rust-lang:main with commit 6fe5302 Nov 9, 2025
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

size_t == uintptr_t check is incorrect

2 participants