File tree Expand file tree Collapse file tree 3 files changed +107
-0
lines changed Expand file tree Collapse file tree 3 files changed +107
-0
lines changed Original file line number Diff line number Diff line change 1+ #![warn(clippy::comment_within_doc)]
2+
3+ //! Hello
4+ //! oups
5+ //! tadam
6+ //~^^^ comment_within_doc
7+
8+ /// Hello
9+ /// oups
10+ /// hehe
11+ //~^^^ comment_within_doc
12+ struct Bar;
13+
14+ mod b {
15+ //! targe
16+ //! oups
17+ //! hello
18+ //
19+ /// nope
20+ /// oups
21+ /// yep
22+ //~^^^ comment_within_doc
23+ //~^^^^^^^^ comment_within_doc
24+ struct Bar;
25+ }
26+
27+ fn main() {}
Original file line number Diff line number Diff line change 1+ #![ warn( clippy:: comment_within_doc) ]
2+
3+ //! Hello
4+ // oups
5+ //! tadam
6+ //~^^^ comment_within_doc
7+
8+ /// Hello
9+ // oups
10+ /// hehe
11+ //~^^^ comment_within_doc
12+ struct Bar ;
13+
14+ mod b {
15+ //! targe
16+ // oups
17+ //! hello
18+ //
19+ /// nope
20+ // oups
21+ /// yep
22+ //~^^^ comment_within_doc
23+ //~^^^^^^^^ comment_within_doc
24+ struct Bar ;
25+ }
26+
27+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error: code comment surrounded by doc comments
2+ --> tests/ui/comment_within_doc.rs:3:1
3+ |
4+ LL | //! Hello
5+ | ^^^^^^^^^
6+ LL | // oups
7+ | --^^^^^
8+ | |
9+ | help: did you mean to make it a doc comment?: `//!`
10+ LL | //! tadam
11+ | ^^^^^^^^^
12+ |
13+ = note: `-D clippy::comment-within-doc` implied by `-D warnings`
14+ = help: to override `-D warnings` add `#[allow(clippy::comment_within_doc)]`
15+
16+ error: code comment surrounded by doc comments
17+ --> tests/ui/comment_within_doc.rs:8:1
18+ |
19+ LL | /// Hello
20+ | ^^^^^^^^^
21+ LL | // oups
22+ | --^^^^^
23+ | |
24+ | help: did you mean to make it a doc comment?: `///`
25+ LL | /// hehe
26+ | ^^^^^^^^
27+
28+ error: code comment surrounded by doc comments
29+ --> tests/ui/comment_within_doc.rs:15:5
30+ |
31+ LL | //! targe
32+ | ^^^^^^^^^
33+ LL | // oups
34+ | --^^^^^
35+ | |
36+ | help: did you mean to make it a doc comment?: `//!`
37+ LL | //! hello
38+ | ^^^^^^^^^
39+
40+ error: code comment surrounded by doc comments
41+ --> tests/ui/comment_within_doc.rs:19:5
42+ |
43+ LL | /// nope
44+ | ^^^^^^^^
45+ LL | // oups
46+ | --^^^^^
47+ | |
48+ | help: did you mean to make it a doc comment?: `///`
49+ LL | /// yep
50+ | ^^^^^^^
51+
52+ error: aborting due to 4 previous errors
53+
You can’t perform that action at this time.
0 commit comments