File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ fn collect_doc_replacements(attrs: &[Attribute]) -> Vec<(Span, String)> {
32
32
. iter ( )
33
33
. filter_map ( |attr| {
34
34
if let AttrKind :: DocComment ( com_kind, sym) = attr. kind
35
+ && !attr. span . from_expansion ( )
35
36
&& com_kind == CommentKind :: Line
36
37
&& let comment = sym. as_str ( )
37
38
&& comment. ends_with ( " " )
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ declare_clippy_lint! {
438
438
/// fn add(l: i32, r: i32) -> i32 {
439
439
/// l + r
440
440
/// }
441
- /// ``````
441
+ /// ```
442
442
///
443
443
/// Use instead:
444
444
/// ```no_run
@@ -450,7 +450,7 @@ declare_clippy_lint! {
450
450
/// ```
451
451
#[ clippy:: version = "1.80.0" ]
452
452
pub DOC_COMMENT_DOUBLE_SPACE_LINEBREAK ,
453
- restriction ,
453
+ pedantic ,
454
454
"double-space used for doc comment linebreak instead of `\\ `"
455
455
}
456
456
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ fn single_line_split() {}
18
18
19
19
// note: cargo fmt can remove double spaces from normal and block comments
20
20
// Should not warn on normal comments
21
- // with double spaces at the end of a line
21
+ // with double spaces at the end of a line
22
22
23
+ #[ doc = "This is a doc attribute, which should not be linted" ]
23
24
fn normal_comment ( ) {
24
25
/*
25
26
Should not warn on block comments
@@ -40,4 +41,21 @@ fn double_space_doc_comment() {}
40
41
/// as a line-break
41
42
fn back_slash_doc_comment ( ) { }
42
43
44
+ /// 🌹 are 🟥
45
+ /// 🌷 are 🟦
46
+ /// 📎 is 😎
47
+ /// and so are 🫵
48
+ /// (hopefully no formatting weirdness linting this)
49
+ fn multi_byte_chars_tada ( ) { }
50
+
51
+ macro_rules! macro_that_makes_function {
52
+ ( ) => {
53
+ /// Shouldn't lint on this!
54
+ /// (hopefully)
55
+ fn my_macro_created_function( ) { }
56
+ }
57
+ }
58
+
59
+ macro_that_makes_function ! ( ) ;
60
+
43
61
fn main ( ) { }
You can’t perform that action at this time.
0 commit comments