Email me

Clippy lints / Suspicious

Clippy lint · Suspicious · checked with Clippy 0.1.99

clippy::four_forward_slashes: this item has comments with 4 forward slashes (`////`). These look like doc comments, but they aren't

What it meansChecks for outer doc comments written with 4 forward slashes (////). It is in the suspicious group and warns by default.

What you see

warning: this item has comments with 4 forward slashes (`////`). These look like doc comments, but they aren't
 --> main.rs:3:1
  |
3 | / //// My amazing data structure
4 | | pub struct Foo {
  | |_^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/stable/index.html#four_forward_slashes
  = note: `#[warn(clippy::four_forward_slashes)]` on by default
help: make this a doc comment by removing one `/`
  |
3 - //// My amazing data structure
4 - pub struct Foo {
3 + /// My amazing data structure
  |

Real output of Clippy 0.1.99 (Rust 1.99) on the example below. Names and line numbers in yours will differ.

Does it matter?

This is (probably) a typo, and results in it not being a doc comment; just a regular comment.

Code that is most likely wrong or useless. Warns by default.

How to fix it

Clippy can fix this one for you: run cargo clippy --fix (add --allow-dirty if you have uncommitted changes). Review the diff before you commit.

Flagged

//// My amazing data structure
pub struct Foo {
    // ...
}

Write this instead

/// My amazing data structure
pub struct Foo {
    // ...
}

Turn it off, or on

Allow it where it does not fit your code, as narrowly as you can:

On one item

#[allow(clippy::four_forward_slashes)]
fn my_function() { /* ... */ }

Whole crate (Cargo.toml)

[lints.clippy]
four_forward_slashes = "allow"

One run

cargo clippy -- -A clippy::four-forward-slashes

The [lints] table needs Rust 1.74 or newer. In a workspace, put it under [workspace.lints.clippy] and add [lints] workspace = true to each member.

Suspiciousgroup
warndefault level
yesfixed by cargo clippy --fix
1.73.0added in Rust

Clippy's own documentation

What it does

Checks for outer doc comments written with 4 forward slashes (////).

Why is this bad?

This is (probably) a typo, and results in it not being a doc comment; just a regular comment.

Example

//// My amazing data structure
pub struct Foo {
    // ...
}

Use instead:

/// My amazing data structure
pub struct Foo {
    // ...
}

From the Clippy lint list (0.1.99), part of the Rust project, MIT or Apache-2.0. Official entry.

Related lints

All 847 Clippy lints · Rust compiler errors · Cargo.toml checker

Up next

Related lintclippy::float_equality_without_absfloat equality check without `.abs()`Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ