Skip to content

Lint idea: unnecessary_doc_comment, inaccessible_doc_comment, or something similar #1575

@smoelius

Description

@smoelius

The Rust compiler has an unused_doc_comments lint that warns about doc comments applied to nodes of the wrong kind. But it does not warn about nodes of the right kind that are simply inaccessible.

Consider the program below (playground). unused_doc_comments warns about doc comment preceding the statement, but not the one preceding the constant.

fn main() {
    /// A constant
    const GREETING: &str = "Hello, world!";
    /// A statement
    println!("{GREETING}");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    lintNew lint or lint enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions