-
Notifications
You must be signed in to change notification settings - Fork 743
Extra assertions and cargo features #618
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
Conversation
This commit ensures that all of the cargo features we have that only exist for CI/testing purposes, and aren't for external consumption, have a "testing_only_" prefix.
src/codegen/mod.rs
Outdated
current_bitfield_layout.is_some()); | ||
debug_assert_eq!(current_bitfield_width.is_some(), | ||
extra_assert_eq!(current_bitfield_width.is_some(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to keep the cheap ones debug_assert_eq!
s, etc, wdyt?
I believe this could hide real bugs.
This commit defines a new set of assertion macros that are only checked in testing/CI when the `testing_only_extra_assertions` feature is enabled. This makes it so that *users* of bindgen that happen to be making a debug build don't enable all these extra and expensive assertions. Additionally, this removes the `testing_only_assert_no_dangling_items` feature, and runs the assertions that were previously gated on that feature when the new `testing_only_extra_assertions` feature is enabled.
2e14b19
to
5004ed4
Compare
@emilio I went over each assertion, and if it was trivial, I left it as a |
Looks great, thanks! @bors-servo r+ |
📌 Commit 5004ed4 has been approved by |
Extra assertions and cargo features * Clean up testing-only cargo features This commit ensures that all of the cargo features we have that only exist for CI/testing purposes, and aren't for external consumption, have a "testing_only_" prefix. * Define extra assertion macros This commit defines a new set of assertion macros that are only checked in testing/CI when the `testing_only_extra_assertions` feature is enabled. This makes it so that *users* of bindgen that happen to be making a debug build don't enable all these extra and expensive assertions. Additionally, this removes the `testing_only_assert_no_dangling_items` feature, and runs the assertions that were previously gated on that feature when the new `testing_only_extra_assertions` feature is enabled. r? @emilio
☀️ Test successful - status-travis |
Clean up testing-only cargo features
This commit ensures that all of the cargo features we have that only exist for
CI/testing purposes, and aren't for external consumption, have a "testing_only_"
prefix.
Define extra assertion macros
This commit defines a new set of assertion macros that are only checked in
testing/CI when the
testing_only_extra_assertions
feature is enabled. Thismakes it so that users of bindgen that happen to be making a debug build don't
enable all these extra and expensive assertions.
Additionally, this removes the
testing_only_assert_no_dangling_items
feature,and runs the assertions that were previously gated on that feature when the new
testing_only_extra_assertions
feature is enabled.r? @emilio