You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use common type alias for anonymous enums in consts mode
Previously, anonymous enums generated a type alias but did not use it.
For example the following:
```C
enum {
ZERO,
ONE = 4999,
};
```
Generated this:
```Rust
/* automatically generated by rust-bindgen 0.59.2 */
pub const ZERO: ::std::os::raw::c_uint = 0;
pub const ONE: ::std::os::raw::c_uint = 4999;
pub type _bindgen_ty_1 = ::std::os::raw::c_uint;
```
For use cases where humans look at bindgen's Rust output this was a little
strange since it's a deviation from how the Rust output for named enums
is organized, where all constants share the same type using the type
alias. The unused type alias also triggered the dead_code lint.
Change to use the generated type alias.
0 commit comments