From 7b99b2512921fd7540a0b8f9717c6e38fec376e1 Mon Sep 17 00:00:00 2001 From: Travis Finkenauer Date: Sun, 11 Mar 2018 18:26:31 -0400 Subject: Fix bug when enum matched multiple types If an enum matched a pattern for rustified enum and constified module enum, then rust code would fail to compile with "ambiguous associated type" error. We fix the error by giving constified module enum "higher precedence". Fixes issue #1198 --- tests/headers/issue-1198-alias-rust-const-mod-enum.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/headers/issue-1198-alias-rust-const-mod-enum.h (limited to 'tests/headers/issue-1198-alias-rust-const-mod-enum.h') diff --git a/tests/headers/issue-1198-alias-rust-const-mod-enum.h b/tests/headers/issue-1198-alias-rust-const-mod-enum.h new file mode 100644 index 00000000..944fac31 --- /dev/null +++ b/tests/headers/issue-1198-alias-rust-const-mod-enum.h @@ -0,0 +1,13 @@ +// bindgen-flags: --rustified-enum '.*' --constified-enum-module '.*' + +typedef enum MyDupeEnum { + A = 0, + A_alias = 0, + B, +} MyDupeEnum; + +enum MyOtherDupeEnum { + C = 0, + C_alias = 0, + D, +}; \ No newline at end of file -- cgit v1.2.3