Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix name collision between C enum and typedef #2326

Merged
merged 2 commits into from
Nov 28, 2022

Commits on Nov 25, 2022

  1. Add test of enum and typedef with same name

        error[E0428]: the name `Enum` is defined multiple times
          --> bindgen-tests/tests/expectations/tests/enum-typedef.rs:10:1
           |
        9  | pub type Enum = ::std::os::raw::c_uint;
           | --------------------------------------- previous definition of the type `Enum` here
        10 | pub type Enum = i16;
           | ^^^^^^^^^^^^^^^^^^^^ `Enum` redefined here
           |
           = note: `Enum` must be defined only once in the type namespace of this module
    
        error[E0428]: the name `TypedefFirst` is defined multiple times
          --> bindgen-tests/tests/expectations/tests/enum-typedef.rs:13:1
           |
        11 | pub type TypedefFirst = i16;
           | ---------------------------- previous definition of the type `TypedefFirst` here
        12 | pub const TypedefFirst_Variant2: TypedefFirst = 0;
        13 | pub type TypedefFirst = ::std::os::raw::c_uint;
           | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `TypedefFirst` redefined here
           |
           = note: `TypedefFirst` must be defined only once in the type namespace of this module
    dtolnay committed Nov 25, 2022
    Configuration menu
    Copy the full SHA
    fad1b50 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0238fc4 View commit details
    Browse the repository at this point in the history