Skip to content

Incorrect doc-comments generated for enum variants #1829

Open
@Michael-F-Bryan

Description

@Michael-F-Bryan

It looks like bindgen sees a doc-comment for a particular enum variant then keeps using the same doc-comment for every variant afterwards, instead of just the variant being documented.

Input C/C++ Header

typedef enum parameter_t {
    speed,
    acceleration,
    /// The amount of backlash in the system.
    backlash,
    desired_speed,
    position,
    desired_position,
} parameter_t;

Bindgen Invocation

$ bindgen input.h

Actual Results

pub const parameter_t_speed: parameter_t = 0;
pub const parameter_t_acceleration: parameter_t = 1;
/// The amount of backlash in the system.
pub const parameter_t_backlash: parameter_t = 2;
/// The amount of backlash in the system.
pub const parameter_t_desired_speed: parameter_t = 3;
/// The amount of backlash in the system.
pub const parameter_t_position: parameter_t = 4;
/// The amount of backlash in the system.
pub const parameter_t_desired_position: parameter_t = 5;
pub type parameter_t = i32;

Expected Results

pub const parameter_t_speed: parameter_t = 0;
pub const parameter_t_acceleration: parameter_t = 1;
/// The amount of backlash in the system.
pub const parameter_t_backlash: parameter_t = 2;
pub const parameter_t_desired_speed: parameter_t = 3;
pub const parameter_t_position: parameter_t = 4;
pub const parameter_t_desired_position: parameter_t = 5;
pub type parameter_t = i32;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions