danlehmann / bitfield

Rust crate for bitfields and bit-enums
MIT License
47 stars 9 forks source link

Builder struct and methods do not have generated documentation #61

Open JohnstonJ opened 1 month ago

JohnstonJ commented 1 month ago

This is not generating all documentation with version 1.3.2 from crates.io:

/// Some struct
#[bitbybit::bitfield(u32)]
pub struct BbyBTest {
    /// lspi
    #[bits(11..=31, rw)]
    pub lspi: u21,

    /// sec ext
    #[bit(10, rw)]
    pub security_extn: bool,

    /// cpu num
    #[bits(7..=9, rw)]
    pub cpu_number: u3,

    /// lin num
    #[bits(0..=6, rw)]
    pub itlines_number: u7,
}
warning: missing documentation for a struct
  --> crates/dv-toolbox-core/src/pack/binary_group.rs:64:1
   |
64 | #[bitbybit::bitfield(u32)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: requested on the command line with `-W missing-docs`
   = note: this warning originates in the attribute macro `bitbybit::bitfield` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: missing documentation for a method
  --> crates/dv-toolbox-core/src/pack/binary_group.rs:64:1
   |
64 | #[bitbybit::bitfield(u32)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this warning originates in the attribute macro `bitbybit::bitfield` (in Nightly builds, run with -Z macro-backtrace for more info)

These warnings only come up when the builder is generated. I generated the documentation, and indeed, the builder struct + all the methods on it are missing documentation.

danlehmann commented 1 month ago

Thanks for the report! I'll look into it