Skip to content

Commit 6fe5302

Browse files
pekkarremilio
authored andcommitted
Remove incorrect size_t_is_usize check
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
1 parent f94b50d commit 6fe5302

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

bindgen/codegen/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -993,13 +993,6 @@ impl CodeGenerator for Type {
993993
layout.size,
994994
ctx.target_pointer_size(),
995995
);
996-
assert_eq!(
997-
layout.align,
998-
ctx.target_pointer_size(),
999-
"Target platform requires `--no-size_t-is-usize`. The alignment of `{spelling}` ({}) does not match the target pointer size ({})",
1000-
layout.align,
1001-
ctx.target_pointer_size(),
1002-
);
1003996
}
1004997
return;
1005998
}

0 commit comments

Comments
 (0)