Skip to content

Commit

Permalink
Update UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 5, 2024
1 parent 394503c commit 07f97a4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
18 changes: 9 additions & 9 deletions tests/ui/empty_line_after/doc_comments.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | / /// for the crate
LL | |
| |_
LL | fn first_in_crate() {}
| ------------------- the comment documents this function
| ----------------- the comment documents this function
|
= note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
Expand All @@ -24,7 +24,7 @@ LL | / /// for the module
LL | |
| |_
LL | fn first_in_module() {}
| -------------------- the comment documents this function
| ------------------ the comment documents this function
|
= help: if the empty line is unintentional remove it
help: if the comment should document the parent module use an inner doc comment
Expand All @@ -42,7 +42,7 @@ LL | |
| |_
LL | /// Blank line
LL | fn indented() {}
| ------------- the comment documents this function
| ----------- the comment documents this function
|
= help: if the empty line is unintentional remove it
help: if the documentation should include the empty line include it in the comment
Expand All @@ -57,7 +57,7 @@ LL | / /// This should produce a warning
LL | |
| |_
LL | fn with_doc_and_newline() {}
| ------------------------- the comment documents this function
| ----------------------- the comment documents this function
|
= help: if the empty line is unintentional remove it

Expand All @@ -72,7 +72,7 @@ LL | |
| |_
...
LL | fn three_attributes() {}
| --------------------- the comment documents this function
| ------------------- the comment documents this function
|
= help: if the empty lines are unintentional remove them

Expand All @@ -84,7 +84,7 @@ LL | | // fn old_code() {}
LL | |
| |_
LL | fn new_code() {}
| ------------- the comment documents this function
| ----------- the comment documents this function
|
= help: if the empty line is unintentional remove it
help: if the doc comment should not document `new_code` comment it out
Expand Down Expand Up @@ -127,7 +127,7 @@ LL | | */
LL | |
| |_
LL | fn first_in_module() {}
| -------------------- the comment documents this function
| ------------------ the comment documents this function
|
= help: if the empty line is unintentional remove it
help: if the comment should document the parent module use an inner doc comment
Expand All @@ -146,7 +146,7 @@ LL | |
| |_
...
LL | fn new_code() {}
| ------------- the comment documents this function
| ----------- the comment documents this function
|
= help: if the empty line is unintentional remove it
help: if the doc comment should not document `new_code` comment it out
Expand All @@ -164,7 +164,7 @@ LL | |
| |_
LL | /// Docs for `new_code2`
LL | fn new_code2() {}
| -------------- the comment documents this function
| ------------ the comment documents this function
|
= help: if the empty line is unintentional remove it
help: if the doc comment should not document `new_code2` comment it out
Expand Down
12 changes: 6 additions & 6 deletions tests/ui/empty_line_after/outer_attribute.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | / #[crate_type = "lib"]
LL | |
| |_
LL | fn first_in_crate() {}
| ------------------- the attribute applies to this function
| ----------------- the attribute applies to this function
|
= note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_outer_attr)]`
Expand All @@ -23,7 +23,7 @@ LL | |
| |_
LL | /// some comment
LL | fn with_one_newline_and_comment() {}
| --------------------------------- the attribute applies to this function
| ------------------------------- the attribute applies to this function
|
= help: if the empty line is unintentional remove it

Expand All @@ -34,7 +34,7 @@ LL | / #[inline]
LL | |
| |_
LL | fn with_one_newline() {}
| --------------------- the attribute applies to this function
| ------------------- the attribute applies to this function
|
= help: if the empty line is unintentional remove it

Expand All @@ -46,7 +46,7 @@ LL | |
LL | |
| |_
LL | fn with_two_newlines() {}
| ---------------------- the attribute applies to this function
| -------------------- the attribute applies to this function
|
= help: if the empty lines are unintentional remove them
help: if the attribute should apply to the parent module use an inner attribute
Expand Down Expand Up @@ -95,7 +95,7 @@ LL | | // Still lint cases where the empty line does not immediately follow the
LL | |
| |_
LL | fn comment_before_empty_line() {}
| ------------------------------ the attribute applies to this function
| ---------------------------- the attribute applies to this function
|
= help: if the empty line is unintentional remove it

Expand All @@ -108,7 +108,7 @@ LL | | // This comment is isolated
LL | |
| |_
LL | pub fn isolated_comment() {}
| ------------------------- the attribute applies to this function
| ----------------------- the attribute applies to this function
|
= help: if the empty lines are unintentional remove them

Expand Down
1 change: 1 addition & 0 deletions tests/ui/suspicious_doc_comments.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(unused)]
#![warn(clippy::suspicious_doc_comments)]
#![allow(clippy::empty_line_after_doc_comments)]

//! Real module documentation.
//! Fake module documentation.
Expand Down
1 change: 1 addition & 0 deletions tests/ui/suspicious_doc_comments.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(unused)]
#![warn(clippy::suspicious_doc_comments)]
#![allow(clippy::empty_line_after_doc_comments)]

//! Real module documentation.
///! Fake module documentation.
Expand Down
18 changes: 9 additions & 9 deletions tests/ui/suspicious_doc_comments.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: this is an outer doc comment and does not apply to the parent module or crate
--> tests/ui/suspicious_doc_comments.rs:5:1
--> tests/ui/suspicious_doc_comments.rs:6:1
|
LL | ///! Fake module documentation.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -12,7 +12,7 @@ LL | //! Fake module documentation.
|

error: this is an outer doc comment and does not apply to the parent module or crate
--> tests/ui/suspicious_doc_comments.rs:9:5
--> tests/ui/suspicious_doc_comments.rs:10:5
|
LL | ///! This module contains useful functions.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -23,7 +23,7 @@ LL | //! This module contains useful functions.
|

error: this is an outer doc comment and does not apply to the parent module or crate
--> tests/ui/suspicious_doc_comments.rs:21:5
--> tests/ui/suspicious_doc_comments.rs:22:5
|
LL | / /**! This module contains useful functions.
LL | | */
Expand All @@ -36,7 +36,7 @@ LL + */
|

error: this is an outer doc comment and does not apply to the parent module or crate
--> tests/ui/suspicious_doc_comments.rs:35:5
--> tests/ui/suspicious_doc_comments.rs:36:5
|
LL | / ///! This module
LL | | ///! contains
Expand All @@ -51,7 +51,7 @@ LL ~ //! useful functions.
|

error: this is an outer doc comment and does not apply to the parent module or crate
--> tests/ui/suspicious_doc_comments.rs:43:5
--> tests/ui/suspicious_doc_comments.rs:44:5
|
LL | / ///! a
LL | | ///! b
Expand All @@ -64,7 +64,7 @@ LL ~ //! b
|

error: this is an outer doc comment and does not apply to the parent module or crate
--> tests/ui/suspicious_doc_comments.rs:51:5
--> tests/ui/suspicious_doc_comments.rs:52:5
|
LL | ///! a
| ^^^^^^
Expand All @@ -75,7 +75,7 @@ LL | //! a
|

error: this is an outer doc comment and does not apply to the parent module or crate
--> tests/ui/suspicious_doc_comments.rs:57:5
--> tests/ui/suspicious_doc_comments.rs:58:5
|
LL | / ///! a
LL | |
Expand All @@ -90,7 +90,7 @@ LL ~ //! b
|

error: this is an outer doc comment and does not apply to the parent module or crate
--> tests/ui/suspicious_doc_comments.rs:69:5
--> tests/ui/suspicious_doc_comments.rs:70:5
|
LL | ///! Very cool macro
| ^^^^^^^^^^^^^^^^^^^^
Expand All @@ -101,7 +101,7 @@ LL | //! Very cool macro
|

error: this is an outer doc comment and does not apply to the parent module or crate
--> tests/ui/suspicious_doc_comments.rs:76:5
--> tests/ui/suspicious_doc_comments.rs:77:5
|
LL | ///! Huh.
| ^^^^^^^^^
Expand Down

0 comments on commit 07f97a4

Please sign in to comment.