Skip to content

Commit 0f20a12

Browse files
authored
ui_test annotation cleanup (rust-lang#14232)
Cleans up some changes from rust-lang/rust-clippy#11421 I searched for any `.stderr` files where the number of errors changed and reverted + manually added the annotations for them Also fixes `tests/ui/asm_syntax_not_x86.rs` r? @flip1995 changelog: none
2 parents 8cef0b6 + d03ae8b commit 0f20a12

24 files changed

+340
-355
lines changed

tests/ui/asm_syntax_not_x86.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ignore-target: i686 x86
22
//@needs-asm-support
3+
//@check-pass
34

45
#[warn(clippy::inline_asm_x86_intel_syntax)]
56
#[warn(clippy::inline_asm_x86_att_syntax)]
@@ -8,17 +9,12 @@ mod dont_warn {
89

910
pub(super) unsafe fn use_asm() {
1011
asm!("");
11-
//~^ inline_asm_x86_intel_syntax
1212
asm!("", options());
13-
//~^ inline_asm_x86_intel_syntax
1413
asm!("", options(nostack));
15-
//~^ inline_asm_x86_intel_syntax
1614
}
1715

1816
global_asm!("");
19-
//~^ inline_asm_x86_intel_syntax
2017
global_asm!("", options());
21-
//~^ inline_asm_x86_intel_syntax
2218
}
2319

2420
fn main() {

tests/ui/attrs.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#![warn(clippy::inline_always, clippy::deprecated_semver)]
2-
#![allow(clippy::assertions_on_constants, clippy::empty_line_after_outer_attr)]
2+
#![allow(clippy::assertions_on_constants)]
33
#![allow(clippy::missing_docs_in_private_items, clippy::panic, clippy::unreachable)]
44

55
#[inline(always)]
66
//~^ inline_always
7-
87
fn test_attr_lint() {
98
assert!(true)
109
}
@@ -26,12 +25,10 @@ fn empty_and_false_positive_stmt() {
2625

2726
#[deprecated(since = "forever")]
2827
//~^ deprecated_semver
29-
3028
pub const SOME_CONST: u8 = 42;
3129

3230
#[deprecated(since = "1")]
3331
//~^ deprecated_semver
34-
3532
pub const ANOTHER_CONST: u8 = 23;
3633

3734
#[deprecated(since = "0.1.1")]

tests/ui/attrs.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: the since field must contain a semver-compliant version
2-
--> tests/ui/attrs.rs:27:14
2+
--> tests/ui/attrs.rs:26:14
33
|
44
LL | #[deprecated(since = "forever")]
55
| ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #[deprecated(since = "forever")]
88
= help: to override `-D warnings` add `#[allow(clippy::deprecated_semver)]`
99

1010
error: the since field must contain a semver-compliant version
11-
--> tests/ui/attrs.rs:32:14
11+
--> tests/ui/attrs.rs:30:14
1212
|
1313
LL | #[deprecated(since = "1")]
1414
| ^^^^^^^^^^^

tests/ui/crashes/ice-5835.fixed

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[rustfmt::skip]
2+
pub struct Foo {
3+
//~v tabs_in_doc_comments
4+
/// 位
5+
/// ^ Do not remove this tab character.
6+
/// It was required to trigger the ICE.
7+
pub bar: u8,
8+
}
9+
10+
fn main() {}

tests/ui/crashes/ice-5835.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#[rustfmt::skip]
22
pub struct Foo {
3+
//~v tabs_in_doc_comments
34
/// 位
4-
//~^ tabs_in_doc_comments
5-
//~| empty_line_after_doc_comments
6-
7-
85
/// ^ Do not remove this tab character.
96
/// It was required to trigger the ICE.
107
pub bar: u8,

tests/ui/crashes/ice-5835.stderr

+2-18
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
11
error: using tabs in doc comments is not recommended
2-
--> tests/ui/crashes/ice-5835.rs:3:10
2+
--> tests/ui/crashes/ice-5835.rs:4:10
33
|
44
LL | /// 位
55
| ^^^^ help: consider using four spaces per tab
66
|
77
= note: `-D clippy::tabs-in-doc-comments` implied by `-D warnings`
88
= help: to override `-D warnings` add `#[allow(clippy::tabs_in_doc_comments)]`
99

10-
error: empty lines after doc comment
11-
--> tests/ui/crashes/ice-5835.rs:3:5
12-
|
13-
LL | / /// 位
14-
... |
15-
LL | |
16-
| |_^
17-
|
18-
= note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
19-
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
20-
= help: if the empty lines are unintentional remove them
21-
help: if the doc comment should not document `bar` comment it out
22-
|
23-
LL | // /// 位
24-
| ++
25-
26-
error: aborting due to 2 previous errors
10+
error: aborting due to 1 previous error
2711

tests/ui/doc/unbalanced_ticks.rs

+10-15
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@
55
#![warn(clippy::doc_markdown)]
66

77
/// This is a doc comment with `unbalanced_tick marks and several words that
8-
//~^ empty_line_after_doc_comments
9-
8+
//~^ doc_markdown
109
/// should be `encompassed_by` tick marks because they `contain_underscores`.
1110
/// Because of the initial `unbalanced_tick` pair, the error message is
1211
/// very `confusing_and_misleading`.
1312
fn main() {}
1413

1514
/// This paragraph has `unbalanced_tick marks and should stop_linting.
16-
//~^ empty_line_after_doc_comments
17-
15+
//~^ doc_markdown
1816
///
1917
/// This paragraph is fine and should_be linted normally.
20-
18+
//~^ doc_markdown
2119
///
2220
/// Double unbalanced backtick from ``here to here` should lint.
23-
21+
//~^ doc_markdown
2422
///
2523
/// Double balanced back ticks ``start end`` is fine.
2624
fn multiple_paragraphs() {}
@@ -34,16 +32,15 @@ fn in_code_block() {}
3432
/// # `Fine`
3533
///
3634
/// ## not_fine
37-
//~^ empty_line_after_doc_comments
38-
35+
//~^ doc_markdown
3936
///
4037
/// ### `unbalanced
41-
38+
//~^ doc_markdown
4239
///
4340
/// - This `item has unbalanced tick marks
44-
41+
//~^ doc_markdown
4542
/// - This item needs backticks_here
46-
43+
//~^ doc_markdown
4744
fn other_markdown() {}
4845

4946
#[rustfmt::skip]
@@ -54,8 +51,7 @@ fn other_markdown() {}
5451
fn issue_7421() {}
5552

5653
/// `
57-
//~^ empty_line_after_doc_comments
58-
54+
//~^ doc_markdown
5955
fn escape_0() {}
6056

6157
/// Escaped \` backticks don't count.
@@ -65,8 +61,7 @@ fn escape_1() {}
6561
fn escape_2() {}
6662

6763
/// Escaped \` ` backticks don't count, but unescaped backticks do.
68-
//~^ empty_line_after_doc_comments
69-
64+
//~^ doc_markdown
7065
fn escape_3() {}
7166

7267
/// Backslashes ` \` within code blocks don't count.

tests/ui/doc/unbalanced_ticks.stderr

+80-94
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,98 @@
1-
error: empty line after doc comment
2-
--> tests/ui/doc/unbalanced_ticks.rs:7:1
1+
error: backticks are unbalanced
2+
--> tests/ui/doc/unbalanced_ticks.rs:7:5
33
|
4-
LL | / /// This is a doc comment with `unbalanced_tick marks and several words that
4+
LL | /// This is a doc comment with `unbalanced_tick marks and several words that
5+
| _____^
56
LL | |
6-
LL | |
7-
| |_^
8-
...
9-
LL | fn main() {}
10-
| --------- the comment documents this function
11-
|
12-
= note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
13-
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
14-
= help: if the empty line is unintentional remove it
15-
help: if the doc comment should not document `main` comment it out
16-
|
17-
LL | // /// This is a doc comment with `unbalanced_tick marks and several words that
18-
| ++
7+
LL | | /// should be `encompassed_by` tick marks because they `contain_underscores`.
8+
LL | | /// Because of the initial `unbalanced_tick` pair, the error message is
9+
LL | | /// very `confusing_and_misleading`.
10+
| |____________________________________^
11+
|
12+
= help: a backtick may be missing a pair
13+
= note: `-D clippy::doc-markdown` implied by `-D warnings`
14+
= help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]`
1915

20-
error: empty lines after doc comment
21-
--> tests/ui/doc/unbalanced_ticks.rs:15:1
16+
error: backticks are unbalanced
17+
--> tests/ui/doc/unbalanced_ticks.rs:14:5
2218
|
23-
LL | / /// This paragraph has `unbalanced_tick marks and should stop_linting.
24-
LL | |
25-
LL | |
26-
LL | | ///
27-
... |
28-
LL | | /// Double unbalanced backtick from ``here to here` should lint.
29-
LL | |
30-
| |_^
31-
...
32-
LL | fn multiple_paragraphs() {}
33-
| ------------------------ the comment documents this function
34-
|
35-
= help: if the empty lines are unintentional remove them
36-
help: if the doc comment should not document `multiple_paragraphs` comment it out
37-
|
38-
LL ~ // /// This paragraph has `unbalanced_tick marks and should stop_linting.
39-
LL |
40-
LL |
41-
LL ~ // ///
42-
LL ~ // /// This paragraph is fine and should_be linted normally.
43-
LL |
44-
LL ~ // ///
45-
LL ~ // /// Double unbalanced backtick from ``here to here` should lint.
19+
LL | /// This paragraph has `unbalanced_tick marks and should stop_linting.
20+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4621
|
22+
= help: a backtick may be missing a pair
4723

48-
error: empty lines after doc comment
49-
--> tests/ui/doc/unbalanced_ticks.rs:36:1
24+
error: item in documentation is missing backticks
25+
--> tests/ui/doc/unbalanced_ticks.rs:17:32
5026
|
51-
LL | / /// ## not_fine
52-
LL | |
53-
LL | |
54-
LL | | ///
55-
... |
56-
LL | | /// - This item needs backticks_here
57-
LL | |
58-
| |_^
59-
LL | fn other_markdown() {}
60-
| ------------------- the comment documents this function
61-
|
62-
= help: if the empty lines are unintentional remove them
63-
help: if the doc comment should not document `other_markdown` comment it out
64-
|
65-
LL ~ // /// # `Fine`
66-
LL ~ // ///
67-
LL ~ // /// ## not_fine
68-
LL |
69-
LL |
70-
LL ~ // ///
71-
LL ~ // /// ### `unbalanced
72-
LL |
73-
LL ~ // ///
74-
LL ~ // /// - This `item has unbalanced tick marks
75-
LL |
76-
LL ~ // /// - This item needs backticks_here
27+
LL | /// This paragraph is fine and should_be linted normally.
28+
| ^^^^^^^^^
7729
|
30+
help: try
31+
|
32+
LL | /// This paragraph is fine and `should_be` linted normally.
33+
| ~~~~~~~~~~~
7834

79-
error: empty line after doc comment
80-
--> tests/ui/doc/unbalanced_ticks.rs:56:1
35+
error: backticks are unbalanced
36+
--> tests/ui/doc/unbalanced_ticks.rs:20:5
8137
|
82-
LL | / /// `
83-
LL | |
84-
LL | |
85-
| |_^
86-
LL | fn escape_0() {}
87-
| ------------- the comment documents this function
38+
LL | /// Double unbalanced backtick from ``here to here` should lint.
39+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8840
|
89-
= help: if the empty line is unintentional remove it
90-
help: if the doc comment should not document `escape_0` comment it out
41+
= help: a backtick may be missing a pair
42+
43+
error: item in documentation is missing backticks
44+
--> tests/ui/doc/unbalanced_ticks.rs:34:8
9145
|
92-
LL | // /// `
93-
| ++
46+
LL | /// ## not_fine
47+
| ^^^^^^^^
48+
|
49+
help: try
50+
|
51+
LL | /// ## `not_fine`
52+
| ~~~~~~~~~~
9453

95-
error: empty line after doc comment
96-
--> tests/ui/doc/unbalanced_ticks.rs:67:1
54+
error: backticks are unbalanced
55+
--> tests/ui/doc/unbalanced_ticks.rs:37:5
9756
|
98-
LL | / /// Escaped \` ` backticks don't count, but unescaped backticks do.
99-
LL | |
100-
LL | |
101-
| |_^
102-
LL | fn escape_3() {}
103-
| ------------- the comment documents this function
57+
LL | /// ### `unbalanced
58+
| ^^^^^^^^^^^^^^^
59+
|
60+
= help: a backtick may be missing a pair
61+
62+
error: backticks are unbalanced
63+
--> tests/ui/doc/unbalanced_ticks.rs:40:5
64+
|
65+
LL | /// - This `item has unbalanced tick marks
66+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67+
|
68+
= help: a backtick may be missing a pair
69+
70+
error: item in documentation is missing backticks
71+
--> tests/ui/doc/unbalanced_ticks.rs:42:23
72+
|
73+
LL | /// - This item needs backticks_here
74+
| ^^^^^^^^^^^^^^
75+
|
76+
help: try
77+
|
78+
LL | /// - This item needs `backticks_here`
79+
| ~~~~~~~~~~~~~~~~
80+
81+
error: backticks are unbalanced
82+
--> tests/ui/doc/unbalanced_ticks.rs:53:5
83+
|
84+
LL | /// `
85+
| ^
86+
|
87+
= help: a backtick may be missing a pair
88+
89+
error: backticks are unbalanced
90+
--> tests/ui/doc/unbalanced_ticks.rs:63:5
10491
|
105-
= help: if the empty line is unintentional remove it
106-
help: if the doc comment should not document `escape_3` comment it out
92+
LL | /// Escaped \` ` backticks don't count, but unescaped backticks do.
93+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10794
|
108-
LL | // /// Escaped \` ` backticks don't count, but unescaped backticks do.
109-
| ++
95+
= help: a backtick may be missing a pair
11096

111-
error: aborting due to 5 previous errors
97+
error: aborting due to 10 previous errors
11298

tests/ui/doc_link_with_quotes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::doc_link_with_quotes)]
2-
#![allow(clippy::empty_line_after_doc_comments)]
32

43
fn main() {
54
foo()

0 commit comments

Comments
 (0)