Skip to content

Regression in v2: flag constants no longer appear in cargo doc output #320

@nicholasbishop

Description

@nicholasbishop

Steps to reproduce:

cargo new --lib bitflags-missing-docs
cd bitflags-missing-docs
cargo add bitflags

Replace src/lib.rs with:

bitflags::bitflags! {
    pub struct Flags: u32 {
        /// Hello.
        const HELLO = 1;
    }
}

Run cargo doc --open and search for "hello". It doesn't find anything of that name, and if you go to the Flags page it indeed has no documented constants.

image

If you change Cargo.toml to use bitflags = "1" and re-run cargo doc, the constant is there as expected:

image

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