binrw icon indicating copy to clipboard operation
binrw copied to clipboard

Deriving BinRead with named arguments fails to compile with `#![deny(missing_docs)]`

Open mvforell opened this issue 2 years ago • 0 comments

Trying to compile code that looks something like this:

#![deny(missing_docs)]

#[derive(BinRead)]
#[br(import { foo: u32 })]
struct Foo {
    bar: u8,
}

results in this error:

error: missing documentation for a struct
   --> src/messages.rs:139:24
    |
139 | #[derive(Clone, Debug, BinRead, BinWrite)]
    |                        ^^^^^^^

I think this is because the generated code for the argument struct (FooBinReadArgs) has no documentation.

Switching from named arguments to tuple-style arguments fixes the error.

mvforell avatar May 29 '22 16:05 mvforell