Skip to content

too_long_first_doc_comment adds outer-comment lines to inner-comments #13447

@clarfonthey

Description

@clarfonthey

Summary

The auto-fix for this lint will add /// as the new line to //! comments, meaning it will break and cause a syntax error.

Reproducer

#![warn(clippy::too_long_first_doc_comment)]
//! This is a one-line summary.
//! This makes the one-line summary no longer one line.

autofixes to:

#![warn(clippy::too_long_first_doc_comment)]
//! This is a one-line summary.
///
//! This makes the one-line summary no longer one line.

Version

rustc 1.83.0-nightly (7042c26 2024-09-23)
binary: rustc
commit-hash: 7042c26
commit-date: 2024-09-23
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Additional Labels

@rustbot label +I-suggestion-causes-error

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when applied

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions