diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-03-17 21:44:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-17 21:44:46 -0400 |
commit | 94f3f6efa89c61e498bc9b780541572dc2f3c005 (patch) | |
tree | c69b21fc8f6eb4529e2b62c4d9ebe4dc10d269d8 /src | |
parent | 22041e13d08dbd4cb0ea777fa540897735d9e7c2 (diff) | |
parent | c0c1dcafe0b470992ae3624bddb6fa102680284b (diff) |
Auto merge of #1277 - tmfink:issue-1198-bitfield-enum, r=emilio
Handle bitfield enum pattern aliasing
The previous fix for issue #1198 was incomplete.
Diffstat (limited to 'src')
-rw-r--r-- | src/codegen/mod.rs | 6 | ||||
-rw-r--r-- | src/lib.rs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index cf1a4f3b..5e104360 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -2479,10 +2479,10 @@ impl CodeGenerator for Enum { // ModuleConsts has higher precedence before Rust in order to avoid problems with // overlapping match patterns - let variation = if self.is_bitfield(ctx, item) { - EnumVariation::Bitfield - } else if self.is_constified_enum_module(ctx, item) { + let variation = if self.is_constified_enum_module(ctx, item) { EnumVariation::ModuleConsts + } else if self.is_bitfield(ctx, item) { + EnumVariation::Bitfield } else if self.is_rustified_enum(ctx, item) { EnumVariation::Rust } else { @@ -161,14 +161,14 @@ impl Default for CodegenConfig { /// Bindgen can map C/C++ enums into Rust in different ways. The way bindgen maps enums depends on /// the pattern passed to several methods: /// -/// 1. [`bitfield_enum()`](#method.bitfield_enum) -/// 2. [`constified_enum_module()`](#method.constified_enum_module) +/// 1. [`constified_enum_module()`](#method.constified_enum_module) +/// 2. [`bitfield_enum()`](#method.bitfield_enum) /// 3. [`rustified_enum()`](#method.rustified_enum) /// /// For each C enum, bindgen tries to match the pattern in the following order: /// -/// 1. Bitfield enum -/// 2. Constified enum module +/// 1. Constified enum module +/// 2. Bitfield enum /// 3. Rustified enum /// /// If none of the above patterns match, then bindgen will generate a set of Rust constants. |