Skip to content

Commit

Permalink
clang: Disable source order sorting for now.
Browse files Browse the repository at this point in the history
This disables (hopefully temporarily) source order sorting, for causing
correctness regressions like rust-lang#2556.

Fixes rust-lang#2556.
  • Loading branch information
emilio committed Jun 15, 2023
1 parent 894535e commit 2b36168
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 86 deletions.
2 changes: 1 addition & 1 deletion bindgen-tests/tests/expectations/tests/allowlist-file.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bindgen-tests/tests/expectations/tests/jsval_layout_opaque.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions bindgen-tests/tests/expectations/tests/layout_arp.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions bindgen-tests/tests/expectations/tests/layout_array.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions bindgen-tests/tests/expectations/tests/layout_eth_conf.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions bindgen-tests/tests/expectations/tests/layout_eth_conf_1_0.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bindgen-tests/tests/expectations/tests/namespace.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions bindgen/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,17 @@ impl Cursor {
) where
Visitor: FnMut(&mut BindgenContext, Cursor),
{
// FIXME(#2556): The current source order stuff doesn't account well for different levels
// of includes, or includes that show up at the same byte offset because they are passed in
// via CLI.
const SOURCE_ORDER_ENABLED: bool = false;
if !SOURCE_ORDER_ENABLED {
return self.visit(|c| {
visitor(ctx, c);
CXChildVisit_Continue
});
}

let mut children = self.collect_children();
for child in &children {
if child.kind() == CXCursor_InclusionDirective {
Expand Down

0 comments on commit 2b36168

Please sign in to comment.