Skip to content

Commit f32e92c

Browse files
committed
add 1 more test and dont trim other code
1 parent 5a50ced commit f32e92c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clippy_lints/src/doc/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc_hir::{AnonConst, Expr};
1717
use rustc_lint::{LateContext, LateLintPass};
1818
use rustc_middle::hir::nested_filter;
1919
use rustc_middle::lint::in_external_macro;
20-
use rustc_middle::ty;
20+
use rustc_middle::ty::{self};
2121
use rustc_resolve::rustdoc::{
2222
add_doc_fragment, attrs_to_doc_fragments, main_body_opts, source_span_for_markdown_range, DocFragment,
2323
};
@@ -556,9 +556,8 @@ fn check_attrs(cx: &LateContext<'_>, valid_idents: &FxHashSet<String>, attrs: &[
556556
acc
557557
});
558558
doc.pop();
559-
let doc = doc.trim().to_string();
560559

561-
if doc.is_empty() {
560+
if doc.trim().is_empty() {
562561
return Some(DocInfo {
563562
empty: true,
564563
doc_headers: DocHeaders::default(),

tests/ui/empty_docs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ fn warn() {
5959
fn dont_warn() {
6060
/*! dont warn me */
6161
}
62+
63+
trait NoDoc {}

0 commit comments

Comments
 (0)