-
Notifications
You must be signed in to change notification settings - Fork 746
Some expected are not overwritten with BINDGEN_OVERWRITE_EXPECTED=1 #2054
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
Comments
Apostoln
added a commit
to Apostoln/rust-bindgen
that referenced
this issue
May 16, 2021
- Replaced dereferencing of null ptr with zero bit pattern + transmute + std::ptr::addr_of! to avoid UB. It affects only checks of fields offsets - Overwritten expected with BINDGEN_OVERWRITE_EXPECTED=1 - Overwritten test_multiple_header_calls_in_builder and test_mixed_header_and_header_contents manually because rust-lang#2054 - Do not check the layout for repr(C) unions - Do not call the destructor of tmp struct to avoid other UB
Yeah, this is expected (and we try to minimize some of the hardcoded tests, and the tests that are dependent on a particular libclang version, but it's non-trivial...) |
emilio
pushed a commit
that referenced
this issue
Jun 6, 2021
- Replaced dereferencing of null ptr with zero bit pattern + transmute + std::ptr::addr_of! to avoid UB. It affects only checks of fields offsets - Overwritten expected with BINDGEN_OVERWRITE_EXPECTED=1 - Overwritten test_multiple_header_calls_in_builder and test_mixed_header_and_header_contents manually because #2054 - Do not check the layout for repr(C) unions - Do not call the destructor of tmp struct to avoid other UB
emilio
pushed a commit
that referenced
this issue
Nov 26, 2021
- Replaced dereferencing of null ptr with zero bit pattern + transmute + std::ptr::addr_of! to avoid UB. It affects only checks of fields offsets - Overwritten expected with BINDGEN_OVERWRITE_EXPECTED=1 - Overwritten test_multiple_header_calls_in_builder and test_mixed_header_and_header_contents manually because #2054 - Do not check the layout for repr(C) unions - Do not call the destructor of tmp struct to avoid other UB
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
STR:
Actual result:
There no changes in appropriate files
test_mixed_header_and_header_contents.rs
andtest_multiple_header_calls_in_builder.rs
intests/expectations/tests/
Expected result:
Tests are passed because expected files are overwritten
As I can see, we are regenerating expected files in
fn compare_generated_header
inside ofmacro_rules! test_header
which is written to$OUT_DIR/out/tests.rs
bybuild.rs
. However, inbuild.rs
we are applying this macro only to headers fromtests/headers
whiletest_mixed_header_and_header_contents.rs
is generated manually from different headers infn test_mixed_header_and_header_contents
(tests/tests.rs
). So, BINDGEN_OVERWRITE_EXPECTED=1 doesn't work here.I've caught this bug in
test_mixed_header_and_header_contents
andtest_multiple_header_calls_in_builder
but I suppose it also affects all tests generated in tests/tests.rs manually.Sorry, the codebase is a new for me, so I don't know how to fix it easily.
The text was updated successfully, but these errors were encountered: