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)> {
3232 . iter ( )
3333 . filter_map ( |attr| {
3434 if let AttrKind :: DocComment ( com_kind, sym) = attr. kind
35+ && !attr. span . from_expansion ( )
3536 && com_kind == CommentKind :: Line
3637 && let comment = sym. as_str ( )
3738 && comment. ends_with ( " " )
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ declare_clippy_lint! {
438438 /// fn add(l: i32, r: i32) -> i32 {
439439 /// l + r
440440 /// }
441- /// ``````
441+ /// ```
442442 ///
443443 /// Use instead:
444444 /// ```no_run
@@ -450,7 +450,7 @@ declare_clippy_lint! {
450450 /// ```
451451 #[ clippy:: version = "1.80.0" ]
452452 pub DOC_COMMENT_DOUBLE_SPACE_LINEBREAK ,
453- restriction ,
453+ pedantic ,
454454 "double-space used for doc comment linebreak instead of `\\ `"
455455}
456456
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ fn single_line_split() {}
1818
1919// note: cargo fmt can remove double spaces from normal and block comments
2020// 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
2222
23+ #[ doc = "This is a doc attribute, which should not be linted" ]
2324fn normal_comment ( ) {
2425 /*
2526 Should not warn on block comments
@@ -40,4 +41,21 @@ fn double_space_doc_comment() {}
4041/// as a line-break
4142fn back_slash_doc_comment ( ) { }
4243
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+
4361fn main ( ) { }
You can’t perform that action at this time.
0 commit comments