Skip to content

Commit 2b36168

Browse files
committed
clang: Disable source order sorting for now.
This disables (hopefully temporarily) source order sorting, for causing correctness regressions like rust-lang#2556. Fixes rust-lang#2556.
1 parent 894535e commit 2b36168

10 files changed

+97
-86
lines changed

bindgen-tests/tests/expectations/tests/allowlist-file.rs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/jsval_layout_opaque.rs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/jsval_layout_opaque_1_0.rs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/layout_arp.rs

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/layout_array.rs

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/layout_eth_conf.rs

+25-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/layout_eth_conf_1_0.rs

+25-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/namespace.rs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/template_instantiation_with_fn_local_type.rs

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen/clang.rs

+11
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,17 @@ impl Cursor {
508508
) where
509509
Visitor: FnMut(&mut BindgenContext, Cursor),
510510
{
511+
// FIXME(#2556): The current source order stuff doesn't account well for different levels
512+
// of includes, or includes that show up at the same byte offset because they are passed in
513+
// via CLI.
514+
const SOURCE_ORDER_ENABLED: bool = false;
515+
if !SOURCE_ORDER_ENABLED {
516+
return self.visit(|c| {
517+
visitor(ctx, c);
518+
CXChildVisit_Continue
519+
});
520+
}
521+
511522
let mut children = self.collect_children();
512523
for child in &children {
513524
if child.kind() == CXCursor_InclusionDirective {

0 commit comments

Comments
 (0)