Skip to content

Commit b7f66a1

Browse files
Update UI tests
1 parent 0550c37 commit b7f66a1

5 files changed

+38
-30
lines changed

Diff for: tests/ui/empty_line_after/doc_comments.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | / /// for the crate
55
LL | |
66
| |_
77
LL | fn first_in_crate() {}
8-
| ------------------- the comment documents this function
8+
| ---------------------- the comment documents this function
99
|
1010
= note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
1111
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
@@ -24,7 +24,7 @@ LL | / /// for the module
2424
LL | |
2525
| |_
2626
LL | fn first_in_module() {}
27-
| -------------------- the comment documents this function
27+
| ----------------------- the comment documents this function
2828
|
2929
= help: if the empty line is unintentional remove it
3030
help: if the comment should document the parent module use an inner doc comment
@@ -42,7 +42,7 @@ LL | |
4242
| |_
4343
LL | /// Blank line
4444
LL | fn indented() {}
45-
| ------------- the comment documents this function
45+
| ---------------- the comment documents this function
4646
|
4747
= help: if the empty line is unintentional remove it
4848
help: if the documentation should include the empty line include it in the comment
@@ -57,7 +57,7 @@ LL | / /// This should produce a warning
5757
LL | |
5858
| |_
5959
LL | fn with_doc_and_newline() {}
60-
| ------------------------- the comment documents this function
60+
| ---------------------------- the comment documents this function
6161
|
6262
= help: if the empty line is unintentional remove it
6363

@@ -72,7 +72,7 @@ LL | |
7272
| |_
7373
...
7474
LL | fn three_attributes() {}
75-
| --------------------- the comment documents this function
75+
| ------------------------ the comment documents this function
7676
|
7777
= help: if the empty lines are unintentional remove them
7878

@@ -84,7 +84,7 @@ LL | | // fn old_code() {}
8484
LL | |
8585
| |_
8686
LL | fn new_code() {}
87-
| ------------- the comment documents this function
87+
| ---------------- the comment documents this function
8888
|
8989
= help: if the empty line is unintentional remove it
9090
help: if the doc comment should not document `new_code` comment it out
@@ -105,7 +105,7 @@ LL | |
105105
| |_
106106
...
107107
LL | struct Multiple;
108-
| --------------- the comment documents this struct
108+
| ---------------- the comment documents this struct
109109
|
110110
= help: if the empty lines are unintentional remove them
111111
help: if the doc comment should not document `Multiple` comment it out
@@ -127,7 +127,7 @@ LL | | */
127127
LL | |
128128
| |_
129129
LL | fn first_in_module() {}
130-
| -------------------- the comment documents this function
130+
| ----------------------- the comment documents this function
131131
|
132132
= help: if the empty line is unintentional remove it
133133
help: if the comment should document the parent module use an inner doc comment
@@ -146,7 +146,7 @@ LL | |
146146
| |_
147147
...
148148
LL | fn new_code() {}
149-
| ------------- the comment documents this function
149+
| ---------------- the comment documents this function
150150
|
151151
= help: if the empty line is unintentional remove it
152152
help: if the doc comment should not document `new_code` comment it out
@@ -164,7 +164,7 @@ LL | |
164164
| |_
165165
LL | /// Docs for `new_code2`
166166
LL | fn new_code2() {}
167-
| -------------- the comment documents this function
167+
| ----------------- the comment documents this function
168168
|
169169
= help: if the empty line is unintentional remove it
170170
help: if the doc comment should not document `new_code2` comment it out

Diff for: tests/ui/empty_line_after/outer_attribute.stderr

+17-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | / #[crate_type = "lib"]
55
LL | |
66
| |_
77
LL | fn first_in_crate() {}
8-
| ------------------- the attribute applies to this function
8+
| ---------------------- the attribute applies to this function
99
|
1010
= note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
1111
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_outer_attr)]`
@@ -23,7 +23,7 @@ LL | |
2323
| |_
2424
LL | /// some comment
2525
LL | fn with_one_newline_and_comment() {}
26-
| --------------------------------- the attribute applies to this function
26+
| ------------------------------------ the attribute applies to this function
2727
|
2828
= help: if the empty line is unintentional remove it
2929

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

@@ -46,7 +46,7 @@ LL | |
4646
LL | |
4747
| |_
4848
LL | fn with_two_newlines() {}
49-
| ---------------------- the attribute applies to this function
49+
| ------------------------- the attribute applies to this function
5050
|
5151
= help: if the empty lines are unintentional remove them
5252
help: if the attribute should apply to the parent module use an inner attribute
@@ -60,8 +60,11 @@ error: empty line after outer attribute
6060
LL | / #[doc = "doc attributes should be considered attributes"]
6161
LL | |
6262
| |_
63-
LL | enum Baz {
64-
| -------- the attribute applies to this enum
63+
LL | / enum Baz {
64+
LL | | One,
65+
LL | | Two,
66+
LL | | }
67+
| |_- the attribute applies to this enum
6568
|
6669
= help: if the empty line is unintentional remove it
6770

@@ -71,8 +74,11 @@ error: empty line after outer attribute
7174
LL | / #[repr(C)]
7275
LL | |
7376
| |_
74-
LL | struct Foo {
75-
| ---------- the attribute applies to this struct
77+
LL | / struct Foo {
78+
LL | | one: isize,
79+
LL | | two: isize,
80+
LL | | }
81+
| |_- the attribute applies to this struct
7682
|
7783
= help: if the empty line is unintentional remove it
7884

@@ -83,7 +89,7 @@ LL | / #[allow(dead_code)]
8389
LL | |
8490
| |_
8591
LL | mod foo {}
86-
| ------- the attribute applies to this module
92+
| ---------- the attribute applies to this module
8793
|
8894
= help: if the empty line is unintentional remove it
8995

@@ -95,7 +101,7 @@ LL | | // Still lint cases where the empty line does not immediately follow the
95101
LL | |
96102
| |_
97103
LL | fn comment_before_empty_line() {}
98-
| ------------------------------ the attribute applies to this function
104+
| --------------------------------- the attribute applies to this function
99105
|
100106
= help: if the empty line is unintentional remove it
101107

@@ -108,7 +114,7 @@ LL | | // This comment is isolated
108114
LL | |
109115
| |_
110116
LL | pub fn isolated_comment() {}
111-
| ------------------------- the attribute applies to this function
117+
| ---------------------------- the attribute applies to this function
112118
|
113119
= help: if the empty lines are unintentional remove them
114120

Diff for: tests/ui/suspicious_doc_comments.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![allow(unused)]
22
#![warn(clippy::suspicious_doc_comments)]
3+
#![allow(clippy::empty_line_after_doc_comments)]
34

45
//! Real module documentation.
56
//! Fake module documentation.

Diff for: tests/ui/suspicious_doc_comments.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![allow(unused)]
22
#![warn(clippy::suspicious_doc_comments)]
3+
#![allow(clippy::empty_line_after_doc_comments)]
34

45
//! Real module documentation.
56
///! Fake module documentation.

Diff for: tests/ui/suspicious_doc_comments.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this is an outer doc comment and does not apply to the parent module or crate
2-
--> tests/ui/suspicious_doc_comments.rs:5:1
2+
--> tests/ui/suspicious_doc_comments.rs:6:1
33
|
44
LL | ///! Fake module documentation.
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -12,7 +12,7 @@ LL | //! Fake module documentation.
1212
|
1313

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)