Skip to content

Commit 315521a

Browse files
committed
fix uitests
1 parent 9be3945 commit 315521a

File tree

5 files changed

+37
-36
lines changed

5 files changed

+37
-36
lines changed

tests/ui/module_name_repetitions.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ LL | pub fn bar_foo() {}
1515
error: item name starts with its containing module's name
1616
--> $DIR/module_name_repetitions.rs:10:5
1717
|
18-
LL | pub struct FooCake {}
19-
| ^^^^^^^^^^^^^^^^^^^^^
18+
LL | pub struct FooCake;
19+
| ^^^^^^^^^^^^^^^^^^^
2020

2121
error: item name ends with its containing module's name
2222
--> $DIR/module_name_repetitions.rs:11:5

tests/ui/no_effect.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ impl FnOnce<(&str,)> for GreetStruct1 {
6868
}
6969
}
7070

71-
struct GreetStruct2;
71+
#[allow(clippy::unit_like_struct_brackets)]
72+
struct GreetStruct2();
7273

7374
impl FnOnce<(&str,)> for GreetStruct2 {
7475
type Output = ();

tests/ui/no_effect.stderr

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,183 +1,183 @@
11
error: statement with no effect
2-
--> $DIR/no_effect.rs:95:5
2+
--> $DIR/no_effect.rs:96:5
33
|
44
LL | 0;
55
| ^^
66
|
77
= note: `-D clippy::no-effect` implied by `-D warnings`
88

99
error: statement with no effect
10-
--> $DIR/no_effect.rs:96:5
10+
--> $DIR/no_effect.rs:97:5
1111
|
1212
LL | s2;
1313
| ^^^
1414

1515
error: statement with no effect
16-
--> $DIR/no_effect.rs:97:5
16+
--> $DIR/no_effect.rs:98:5
1717
|
1818
LL | Unit;
1919
| ^^^^^
2020

2121
error: statement with no effect
22-
--> $DIR/no_effect.rs:98:5
22+
--> $DIR/no_effect.rs:99:5
2323
|
2424
LL | Tuple(0);
2525
| ^^^^^^^^^
2626

2727
error: statement with no effect
28-
--> $DIR/no_effect.rs:99:5
28+
--> $DIR/no_effect.rs:100:5
2929
|
3030
LL | Struct { field: 0 };
3131
| ^^^^^^^^^^^^^^^^^^^^
3232

3333
error: statement with no effect
34-
--> $DIR/no_effect.rs:100:5
34+
--> $DIR/no_effect.rs:101:5
3535
|
3636
LL | Struct { ..s };
3737
| ^^^^^^^^^^^^^^^
3838

3939
error: statement with no effect
40-
--> $DIR/no_effect.rs:101:5
40+
--> $DIR/no_effect.rs:102:5
4141
|
4242
LL | Union { a: 0 };
4343
| ^^^^^^^^^^^^^^^
4444

4545
error: statement with no effect
46-
--> $DIR/no_effect.rs:102:5
46+
--> $DIR/no_effect.rs:103:5
4747
|
4848
LL | Enum::Tuple(0);
4949
| ^^^^^^^^^^^^^^^
5050

5151
error: statement with no effect
52-
--> $DIR/no_effect.rs:103:5
52+
--> $DIR/no_effect.rs:104:5
5353
|
5454
LL | Enum::Struct { field: 0 };
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
5656

5757
error: statement with no effect
58-
--> $DIR/no_effect.rs:104:5
58+
--> $DIR/no_effect.rs:105:5
5959
|
6060
LL | 5 + 6;
6161
| ^^^^^^
6262

6363
error: statement with no effect
64-
--> $DIR/no_effect.rs:105:5
64+
--> $DIR/no_effect.rs:106:5
6565
|
6666
LL | *&42;
6767
| ^^^^^
6868

6969
error: statement with no effect
70-
--> $DIR/no_effect.rs:106:5
70+
--> $DIR/no_effect.rs:107:5
7171
|
7272
LL | &6;
7373
| ^^^
7474

7575
error: statement with no effect
76-
--> $DIR/no_effect.rs:107:5
76+
--> $DIR/no_effect.rs:108:5
7777
|
7878
LL | (5, 6, 7);
7979
| ^^^^^^^^^^
8080

8181
error: statement with no effect
82-
--> $DIR/no_effect.rs:108:5
82+
--> $DIR/no_effect.rs:109:5
8383
|
8484
LL | box 42;
8585
| ^^^^^^^
8686

8787
error: statement with no effect
88-
--> $DIR/no_effect.rs:109:5
88+
--> $DIR/no_effect.rs:110:5
8989
|
9090
LL | ..;
9191
| ^^^
9292

9393
error: statement with no effect
94-
--> $DIR/no_effect.rs:110:5
94+
--> $DIR/no_effect.rs:111:5
9595
|
9696
LL | 5..;
9797
| ^^^^
9898

9999
error: statement with no effect
100-
--> $DIR/no_effect.rs:111:5
100+
--> $DIR/no_effect.rs:112:5
101101
|
102102
LL | ..5;
103103
| ^^^^
104104

105105
error: statement with no effect
106-
--> $DIR/no_effect.rs:112:5
106+
--> $DIR/no_effect.rs:113:5
107107
|
108108
LL | 5..6;
109109
| ^^^^^
110110

111111
error: statement with no effect
112-
--> $DIR/no_effect.rs:113:5
112+
--> $DIR/no_effect.rs:114:5
113113
|
114114
LL | 5..=6;
115115
| ^^^^^^
116116

117117
error: statement with no effect
118-
--> $DIR/no_effect.rs:114:5
118+
--> $DIR/no_effect.rs:115:5
119119
|
120120
LL | [42, 55];
121121
| ^^^^^^^^^
122122

123123
error: statement with no effect
124-
--> $DIR/no_effect.rs:115:5
124+
--> $DIR/no_effect.rs:116:5
125125
|
126126
LL | [42, 55][1];
127127
| ^^^^^^^^^^^^
128128

129129
error: statement with no effect
130-
--> $DIR/no_effect.rs:116:5
130+
--> $DIR/no_effect.rs:117:5
131131
|
132132
LL | (42, 55).1;
133133
| ^^^^^^^^^^^
134134

135135
error: statement with no effect
136-
--> $DIR/no_effect.rs:117:5
136+
--> $DIR/no_effect.rs:118:5
137137
|
138138
LL | [42; 55];
139139
| ^^^^^^^^^
140140

141141
error: statement with no effect
142-
--> $DIR/no_effect.rs:118:5
142+
--> $DIR/no_effect.rs:119:5
143143
|
144144
LL | [42; 55][13];
145145
| ^^^^^^^^^^^^^
146146

147147
error: statement with no effect
148-
--> $DIR/no_effect.rs:120:5
148+
--> $DIR/no_effect.rs:121:5
149149
|
150150
LL | || x += 5;
151151
| ^^^^^^^^^^
152152

153153
error: statement with no effect
154-
--> $DIR/no_effect.rs:122:5
154+
--> $DIR/no_effect.rs:123:5
155155
|
156156
LL | FooString { s: s };
157157
| ^^^^^^^^^^^^^^^^^^^
158158

159159
error: binding to `_` prefixed variable with no side-effect
160-
--> $DIR/no_effect.rs:123:5
160+
--> $DIR/no_effect.rs:124:5
161161
|
162162
LL | let _unused = 1;
163163
| ^^^^^^^^^^^^^^^^
164164
|
165165
= note: `-D clippy::no-effect-underscore-binding` implied by `-D warnings`
166166

167167
error: binding to `_` prefixed variable with no side-effect
168-
--> $DIR/no_effect.rs:124:5
168+
--> $DIR/no_effect.rs:125:5
169169
|
170170
LL | let _penguin = || println!("Some helpful closure");
171171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
172172

173173
error: binding to `_` prefixed variable with no side-effect
174-
--> $DIR/no_effect.rs:125:5
174+
--> $DIR/no_effect.rs:126:5
175175
|
176176
LL | let _duck = Struct { field: 0 };
177177
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178178

179179
error: binding to `_` prefixed variable with no side-effect
180-
--> $DIR/no_effect.rs:126:5
180+
--> $DIR/no_effect.rs:127:5
181181
|
182182
LL | let _cat = [2, 4, 6, 8][2];
183183
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/redundant_allocation_fixable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![allow(clippy::blacklisted_name, unused_variables, dead_code)]
55
#![allow(unused_imports)]
66

7-
pub struct MyStruct {}
7+
pub struct MyStruct;
88

99
pub struct SubT<T> {
1010
foo: T,

tests/ui/unit_like_struct_brackets.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
error: found empty brackets on struct declaration
22
--> $DIR/unit_like_struct_brackets.rs:5:25
33
|
4-
LL | pub struct MyEmptyStruct {} // should trigger lint
4+
LL | pub struct MyEmptyStruct {} // should trigger lint
55
| ^^^ help: remove the brackets: `;`
66
|
77
= note: `-D clippy::unit-like-struct-brackets` implied by `-D warnings`
88

99
error: found empty brackets on struct declaration
1010
--> $DIR/unit_like_struct_brackets.rs:6:26
1111
|
12-
LL | struct MyEmptyTupleStruct(); // should trigger lint
12+
LL | struct MyEmptyTupleStruct(); // should trigger lint
1313
| ^^^ help: remove the brackets: `;`
1414

1515
error: aborting due to 2 previous errors

0 commit comments

Comments
 (0)