Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SabrinaJewson opened this issue Mar 11, 2023 · 0 comments · Fixed by #10497
Closed

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

SabrinaJewson opened this issue Mar 11, 2023 · 0 comments · Fixed by #10497
Labels
A-lint Area: New lints

Comments

@SabrinaJewson
Copy link
Contributor

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() {}
@SabrinaJewson SabrinaJewson added the A-lint Area: New lints label Mar 11, 2023
@bors bors closed this as completed in 4a2cb5a Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant