Skip to content

Invalid code generated when a struct contains fields called type and type_ #507

Open
@sgrif

Description

@sgrif

Header to reproduce:

typedef struct foo {
  int type;
  int type_;
};

The resulting code will be:

#[repr(C)]
#[derive(Debug, Copy)]
pub struct foo {
    pub type_: ::std::os::raw::c_int,
    pub type_: ::std::os::raw::c_int,
}

Which is of course, invalid. It would probably make sense to at least give an error rather than generating invalid code here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions