RS.CLIPPY.EMPTY_LINE_AFTER_DOC_COMMENTS
Empty line after doc comments
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: empty_line_after_doc_comments. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for empty lines after doc comments.
Why is this bad?
The doc comment may have meant to be an inner doc comment, regular comment or applied to some old code that is now commented out. If it was intended to be a doc comment, then the empty line should be removed.
Example
/// Some doc comment with a blank line after it.
fn f() {}
/// Docs for `old_code`
// fn old_code() {}
fn new_code() {}
Use instead:
//! Convert it to an inner doc comment
// Or a regular comment
/// Or remove the empty line
fn f() {}
// /// Docs for `old_code`
// fn old_code() {}
fn new_code() {}