File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 11use clippy_utils:: diagnostics:: span_lint_and_help;
22use rustc_ast:: ast:: * ;
33use rustc_lint:: { EarlyContext , EarlyLintPass } ;
4- use rustc_session:: { declare_lint_pass, declare_tool_lint } ;
4+ use rustc_session:: declare_lint_pass;
55
66declare_clippy_lint ! {
77 /// ### What it does
@@ -35,6 +35,7 @@ fn trim_comment(comment: &str) -> String {
3535 . trim ( )
3636 . split ( "\n " )
3737 . map ( |comment| comment. trim ( ) . trim_matches ( '*' ) . trim_matches ( '!' ) )
38+ . filter ( |line| !line. is_empty ( ) )
3839 . collect :: < Vec < & str > > ( )
3940 . join ( "" )
4041}
Original file line number Diff line number Diff line change 11error: empty doc comment
2- --> $DIR /empty_docs.rs:11:5
2+ --> tests/ui /empty_docs.rs:11:5
33 |
44LL | ///
55 | ^^^
@@ -9,15 +9,15 @@ LL | ///
99 = help: to override `-D warnings` add `#[allow(clippy::empty_docs)]`
1010
1111error: empty doc comment
12- --> $DIR /empty_docs.rs:13:5
12+ --> tests/ui /empty_docs.rs:13:5
1313 |
1414LL | ///
1515 | ^^^
1616 |
1717 = help: consider removing or fill it
1818
1919error: empty doc comment
20- --> $DIR /empty_docs.rs:16:5
20+ --> tests/ui /empty_docs.rs:16:5
2121 |
2222LL | / /**
2323LL | | *
@@ -27,15 +27,15 @@ LL | | */
2727 = help: consider removing or fill it
2828
2929error: empty doc comment
30- --> $DIR /empty_docs.rs:6:5
30+ --> tests/ui /empty_docs.rs:6:5
3131 |
3232LL | //!
3333 | ^^^
3434 |
3535 = help: consider removing or fill it
3636
3737error: empty doc comment
38- --> $DIR /empty_docs.rs:8:5
38+ --> tests/ui /empty_docs.rs:8:5
3939 |
4040LL | //!!
4141 | ^^^^
You can’t perform that action at this time.
0 commit comments