Skip to content

Clippy flags tabs before a multiline block comment #11471

@LAC-Tech

Description

@LAC-Tech

Summary

If tabs exist before the asterisk of a multiline comment, clippy will flag it.

Lint Name

clippy::tabs_in_doc_comments

Reproducer

I tried this code:

mod clippy { /**  * This comment is fine  */ pub const I_LOVE_TABS: bool = true; }

I saw this happen:

warning: using tabs in doc comments is not recommended --> src/lib.rs:13:1 | 13 | * This comment is fine | ^^^^ help: consider using four spaces per tab | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments = note: `#[warn(clippy::tabs_in_doc_comments)]` on by default warning: using tabs in doc comments is not recommended --> src/lib.rs:14:1 | 14 | */ | ^^^^ help: consider using four spaces per tab | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments 

I expected to see this happen:

Nothing should happen, the tabs are outside the comment.

Version

rustc 1.72.0 (5680fa18f 2023-08-23) binary: rustc commit-hash: 5680fa18feaa87f3ff04063800aec256c3d4b4be commit-date: 2023-08-23 host: x86_64-unknown-linux-musl release: 1.72.0 LLVM version: 16.0.5 

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions