Skip to content

Commit 733e1d4

Browse files
committed
Show duplicate diagnostics in UI tests by default
1 parent 1013617 commit 733e1d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+375
-318
lines changed

tests/compile-test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ fn base_config(test_dir: &str) -> (Config, Args) {
138138
"-Aunused",
139139
"-Ainternal_features",
140140
"-Zui-testing",
141+
"-Zdeduplicate-diagnostics=no",
141142
"-Dwarnings",
142143
&format!("-Ldependency={}", deps_path.display()),
143144
]

tests/ui-internal/custom_ice_message.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy
88

99
note: rustc <version> running on <target>
1010

11-
note: compiler flags: -Z ui-testing
11+
note: compiler flags: -Z ui-testing -Z deduplicate-diagnostics=no
1212

1313
note: Clippy version: foo
1414

tests/ui/assign_ops2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
//@no-rustfix: overlapping suggestions
2+
//@compile-flags: -Zdeduplicate-diagnostics=yes
3+
24
#![allow(clippy::uninlined_format_args)]
35

46
#[allow(unused_assignments)]

tests/ui/assign_ops2.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: variable appears on both sides of an assignment operation
2-
--> tests/ui/assign_ops2.rs:8:5
2+
--> tests/ui/assign_ops2.rs:10:5
33
|
44
LL | a += a + 1;
55
| ^^^^^^^^^^
@@ -16,7 +16,7 @@ LL | a = a + a + 1;
1616
| ~~~~~~~~~~~~~
1717

1818
error: variable appears on both sides of an assignment operation
19-
--> tests/ui/assign_ops2.rs:11:5
19+
--> tests/ui/assign_ops2.rs:13:5
2020
|
2121
LL | a += 1 + a;
2222
| ^^^^^^^^^^
@@ -31,7 +31,7 @@ LL | a = a + 1 + a;
3131
| ~~~~~~~~~~~~~
3232

3333
error: variable appears on both sides of an assignment operation
34-
--> tests/ui/assign_ops2.rs:13:5
34+
--> tests/ui/assign_ops2.rs:15:5
3535
|
3636
LL | a -= a - 1;
3737
| ^^^^^^^^^^
@@ -46,7 +46,7 @@ LL | a = a - (a - 1);
4646
| ~~~~~~~~~~~~~~~
4747

4848
error: variable appears on both sides of an assignment operation
49-
--> tests/ui/assign_ops2.rs:15:5
49+
--> tests/ui/assign_ops2.rs:17:5
5050
|
5151
LL | a *= a * 99;
5252
| ^^^^^^^^^^^
@@ -61,7 +61,7 @@ LL | a = a * a * 99;
6161
| ~~~~~~~~~~~~~~
6262

6363
error: variable appears on both sides of an assignment operation
64-
--> tests/ui/assign_ops2.rs:17:5
64+
--> tests/ui/assign_ops2.rs:19:5
6565
|
6666
LL | a *= 42 * a;
6767
| ^^^^^^^^^^^
@@ -76,7 +76,7 @@ LL | a = a * 42 * a;
7676
| ~~~~~~~~~~~~~~
7777

7878
error: variable appears on both sides of an assignment operation
79-
--> tests/ui/assign_ops2.rs:19:5
79+
--> tests/ui/assign_ops2.rs:21:5
8080
|
8181
LL | a /= a / 2;
8282
| ^^^^^^^^^^
@@ -91,7 +91,7 @@ LL | a = a / (a / 2);
9191
| ~~~~~~~~~~~~~~~
9292

9393
error: variable appears on both sides of an assignment operation
94-
--> tests/ui/assign_ops2.rs:21:5
94+
--> tests/ui/assign_ops2.rs:23:5
9595
|
9696
LL | a %= a % 5;
9797
| ^^^^^^^^^^
@@ -106,7 +106,7 @@ LL | a = a % (a % 5);
106106
| ~~~~~~~~~~~~~~~
107107

108108
error: variable appears on both sides of an assignment operation
109-
--> tests/ui/assign_ops2.rs:23:5
109+
--> tests/ui/assign_ops2.rs:25:5
110110
|
111111
LL | a &= a & 1;
112112
| ^^^^^^^^^^
@@ -121,7 +121,7 @@ LL | a = a & a & 1;
121121
| ~~~~~~~~~~~~~
122122

123123
error: variable appears on both sides of an assignment operation
124-
--> tests/ui/assign_ops2.rs:25:5
124+
--> tests/ui/assign_ops2.rs:27:5
125125
|
126126
LL | a *= a * a;
127127
| ^^^^^^^^^^
@@ -136,7 +136,7 @@ LL | a = a * a * a;
136136
| ~~~~~~~~~~~~~
137137

138138
error: manual implementation of an assign operation
139-
--> tests/ui/assign_ops2.rs:63:5
139+
--> tests/ui/assign_ops2.rs:65:5
140140
|
141141
LL | buf = buf + cows.clone();
142142
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `buf += cows.clone()`

tests/ui/else_if_without_else.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@compile-flags: -Zdeduplicate-diagnostics=yes
2+
13
#![warn(clippy::all)]
24
#![warn(clippy::else_if_without_else)]
35

tests/ui/else_if_without_else.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `if` expression with an `else if`, but without a final `else`
2-
--> tests/ui/else_if_without_else.rs:45:12
2+
--> tests/ui/else_if_without_else.rs:47:12
33
|
44
LL | } else if bla2() {
55
| ____________^
@@ -13,7 +13,7 @@ LL | | }
1313
= help: to override `-D warnings` add `#[allow(clippy::else_if_without_else)]`
1414

1515
error: `if` expression with an `else if`, but without a final `else`
16-
--> tests/ui/else_if_without_else.rs:54:12
16+
--> tests/ui/else_if_without_else.rs:56:12
1717
|
1818
LL | } else if bla3() {
1919
| ____________^

tests/ui/identity_op.fixed

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@compile-flags: -Zdeduplicate-diagnostics=yes
2+
13
#![warn(clippy::identity_op)]
24
#![allow(unused)]
35
#![allow(
@@ -134,7 +136,7 @@ fn main() {
134136
//~^ ERROR: this operation has no effect
135137
f(if b { 1 } else { 2 } + 3);
136138
//~^ ERROR: this operation has no effect
137-
139+
138140
const _: i32 = { 2 * 4 } + 3;
139141
//~^ ERROR: this operation has no effect
140142
const _: i32 = { 1 + 2 * 3 } + 3;

tests/ui/identity_op.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@compile-flags: -Zdeduplicate-diagnostics=yes
2+
13
#![warn(clippy::identity_op)]
24
#![allow(unused)]
35
#![allow(
@@ -134,7 +136,7 @@ fn main() {
134136
//~^ ERROR: this operation has no effect
135137
f(0 + if b { 1 } else { 2 } + 3);
136138
//~^ ERROR: this operation has no effect
137-
139+
138140
const _: i32 = { 2 * 4 } + 0 + 3;
139141
//~^ ERROR: this operation has no effect
140142
const _: i32 = 0 + { 1 + 2 * 3 } + 3;

0 commit comments

Comments
 (0)