rust-lang / rust-lang/rust-bindgen
Incorrect doc-comments generated for enum variants
Open
@kulp is already working on this.
Since Jul 17, 2020.
A-libclang
bug
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
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;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.