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 0550c37 commit b7f66a1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 30 deletions.
20 changes: 10 additions & 10 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 All @@ -105,7 +105,7 @@ LL | |
| |_
...
LL | struct Multiple;
| --------------- the comment documents this struct
| ---------------- the comment documents this struct
|
= help: if the empty lines are unintentional remove them
help: if the doc comment should not document `Multiple` comment it out
Expand All @@ -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
28 changes: 17 additions & 11 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 All @@ -60,8 +60,11 @@ error: empty line after outer attribute
LL | / #[doc = "doc attributes should be considered attributes"]
LL | |
| |_
LL | enum Baz {
| -------- the attribute applies to this enum
LL | / enum Baz {
LL | | One,
LL | | Two,
LL | | }
| |_- the attribute applies to this enum
|
= help: if the empty line is unintentional remove it

Expand All @@ -71,8 +74,11 @@ error: empty line after outer attribute
LL | / #[repr(C)]
LL | |
| |_
LL | struct Foo {
| ---------- the attribute applies to this struct
LL | / struct Foo {
LL | | one: isize,
LL | | two: isize,
LL | | }
| |_- the attribute applies to this struct
|
= help: if the empty line is unintentional remove it

Expand All @@ -83,7 +89,7 @@ LL | / #[allow(dead_code)]
LL | |
| |_
LL | mod foo {}
| ------- the attribute applies to this module
| ---------- the attribute applies to this module
|
= help: if the empty line is unintentional remove it

Expand All @@ -95,7 +101,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 +114,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 b7f66a1

Please sign in to comment.