Skip to content

Warn on accidental triple-slash doc comment ///! #10485

Closed
@SabrinaJewson

Description

@SabrinaJewson

What it does

Checks for use of ///! and warns against it. For example:

///! This crate does cool things.

pub fn example() {}

It’s not immediately obvious, but the doc comment is attached to the wrong item.

Lint Name

suspicious_doc_comment

Category

suspicious

Advantage

Users are less likely to make this mistake and be confused by it / have worse documentation because of it.

Drawbacks

Nothing I can think of.

Example

///! This crate does cool things.

pub fn example() {}

Could be written as:

//! This crate does cool things.

pub fn example() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions