@@ -73,7 +73,7 @@ struct T;
73
73
impl T {
74
74
// should not trigger lint
75
75
pub fn new ( ) -> Self {
76
- unimplemented ! ( ) ;
76
+ unimplemented ! ( )
77
77
}
78
78
}
79
79
@@ -83,7 +83,7 @@ impl U {
83
83
// should trigger lint
84
84
pub fn new ( ) -> u32 {
85
85
//~^ ERROR: methods called `new` usually return `Self`
86
- unimplemented ! ( ) ;
86
+ unimplemented ! ( )
87
87
}
88
88
}
89
89
@@ -93,7 +93,7 @@ impl V {
93
93
// should trigger lint
94
94
pub fn new ( _: String ) -> u32 {
95
95
//~^ ERROR: methods called `new` usually return `Self`
96
- unimplemented ! ( ) ;
96
+ unimplemented ! ( )
97
97
}
98
98
}
99
99
@@ -102,7 +102,7 @@ struct TupleReturnerOk;
102
102
impl TupleReturnerOk {
103
103
// should not trigger lint
104
104
pub fn new ( ) -> ( Self , u32 ) {
105
- unimplemented ! ( ) ;
105
+ unimplemented ! ( )
106
106
}
107
107
}
108
108
@@ -111,7 +111,7 @@ struct TupleReturnerOk2;
111
111
impl TupleReturnerOk2 {
112
112
// should not trigger lint (it doesn't matter which element in the tuple is Self)
113
113
pub fn new ( ) -> ( u32 , Self ) {
114
- unimplemented ! ( ) ;
114
+ unimplemented ! ( )
115
115
}
116
116
}
117
117
@@ -120,7 +120,7 @@ struct TupleReturnerOk3;
120
120
impl TupleReturnerOk3 {
121
121
// should not trigger lint (tuple can contain multiple Self)
122
122
pub fn new ( ) -> ( Self , Self ) {
123
- unimplemented ! ( ) ;
123
+ unimplemented ! ( )
124
124
}
125
125
}
126
126
@@ -130,7 +130,7 @@ impl TupleReturnerBad {
130
130
// should trigger lint
131
131
pub fn new ( ) -> ( u32 , u32 ) {
132
132
//~^ ERROR: methods called `new` usually return `Self`
133
- unimplemented ! ( ) ;
133
+ unimplemented ! ( )
134
134
}
135
135
}
136
136
@@ -139,7 +139,7 @@ struct MutPointerReturnerOk;
139
139
impl MutPointerReturnerOk {
140
140
// should not trigger lint
141
141
pub fn new ( ) -> * mut Self {
142
- unimplemented ! ( ) ;
142
+ unimplemented ! ( )
143
143
}
144
144
}
145
145
@@ -148,7 +148,7 @@ struct ConstPointerReturnerOk2;
148
148
impl ConstPointerReturnerOk2 {
149
149
// should not trigger lint
150
150
pub fn new ( ) -> * const Self {
151
- unimplemented ! ( ) ;
151
+ unimplemented ! ( )
152
152
}
153
153
}
154
154
@@ -158,7 +158,7 @@ impl MutPointerReturnerBad {
158
158
// should trigger lint
159
159
pub fn new ( ) -> * mut V {
160
160
//~^ ERROR: methods called `new` usually return `Self`
161
- unimplemented ! ( ) ;
161
+ unimplemented ! ( )
162
162
}
163
163
}
164
164
@@ -167,7 +167,7 @@ struct GenericReturnerOk;
167
167
impl GenericReturnerOk {
168
168
// should not trigger lint
169
169
pub fn new ( ) -> Option < Self > {
170
- unimplemented ! ( ) ;
170
+ unimplemented ! ( )
171
171
}
172
172
}
173
173
@@ -177,7 +177,7 @@ impl GenericReturnerBad {
177
177
// should trigger lint
178
178
pub fn new ( ) -> Option < u32 > {
179
179
//~^ ERROR: methods called `new` usually return `Self`
180
- unimplemented ! ( ) ;
180
+ unimplemented ! ( )
181
181
}
182
182
}
183
183
@@ -186,7 +186,7 @@ struct NestedReturnerOk;
186
186
impl NestedReturnerOk {
187
187
// should not trigger lint
188
188
pub fn new ( ) -> ( Option < Self > , u32 ) {
189
- unimplemented ! ( ) ;
189
+ unimplemented ! ( )
190
190
}
191
191
}
192
192
@@ -195,7 +195,7 @@ struct NestedReturnerOk2;
195
195
impl NestedReturnerOk2 {
196
196
// should not trigger lint
197
197
pub fn new ( ) -> ( ( Self , u32 ) , u32 ) {
198
- unimplemented ! ( ) ;
198
+ unimplemented ! ( )
199
199
}
200
200
}
201
201
@@ -204,7 +204,7 @@ struct NestedReturnerOk3;
204
204
impl NestedReturnerOk3 {
205
205
// should not trigger lint
206
206
pub fn new ( ) -> Option < ( Self , u32 ) > {
207
- unimplemented ! ( ) ;
207
+ unimplemented ! ( )
208
208
}
209
209
}
210
210
@@ -215,7 +215,7 @@ struct WithLifetime<'a> {
215
215
impl < ' a > WithLifetime < ' a > {
216
216
// should not trigger the lint, because the lifetimes are different
217
217
pub fn new < ' b : ' a > ( s : & ' b str ) -> WithLifetime < ' b > {
218
- unimplemented ! ( ) ;
218
+ unimplemented ! ( )
219
219
}
220
220
}
221
221
@@ -236,7 +236,7 @@ mod issue5435 {
236
236
impl TraitRet for StructRet {
237
237
// should not trigger lint as we are in the impl block
238
238
fn new ( ) -> String {
239
- unimplemented ! ( ) ;
239
+ unimplemented ! ( )
240
240
}
241
241
}
242
242
@@ -252,7 +252,7 @@ mod issue5435 {
252
252
where
253
253
Self : Sized ,
254
254
{
255
- unimplemented ! ( ) ;
255
+ unimplemented ! ( )
256
256
}
257
257
}
258
258
@@ -262,7 +262,7 @@ mod issue5435 {
262
262
where
263
263
Self : Sized ,
264
264
{
265
- unimplemented ! ( ) ;
265
+ unimplemented ! ( )
266
266
}
267
267
}
268
268
@@ -272,15 +272,15 @@ mod issue5435 {
272
272
where
273
273
Self : Sized ,
274
274
{
275
- unimplemented ! ( ) ;
275
+ unimplemented ! ( )
276
276
}
277
277
}
278
278
279
279
trait TupleReturnerBad {
280
280
// should trigger lint
281
281
fn new ( ) -> ( u32 , u32 ) {
282
282
//~^ ERROR: methods called `new` usually return `Self`
283
- unimplemented ! ( ) ;
283
+ unimplemented ! ( )
284
284
}
285
285
}
286
286
@@ -290,7 +290,7 @@ mod issue5435 {
290
290
where
291
291
Self : Sized ,
292
292
{
293
- unimplemented ! ( ) ;
293
+ unimplemented ! ( )
294
294
}
295
295
}
296
296
@@ -300,15 +300,15 @@ mod issue5435 {
300
300
where
301
301
Self : Sized ,
302
302
{
303
- unimplemented ! ( ) ;
303
+ unimplemented ! ( )
304
304
}
305
305
}
306
306
307
307
trait MutPointerReturnerBad {
308
308
// should trigger lint
309
309
fn new ( ) -> * mut V {
310
310
//~^ ERROR: methods called `new` usually return `Self`
311
- unimplemented ! ( ) ;
311
+ unimplemented ! ( )
312
312
}
313
313
}
314
314
@@ -318,7 +318,7 @@ mod issue5435 {
318
318
where
319
319
Self : Sized ,
320
320
{
321
- unimplemented ! ( ) ;
321
+ unimplemented ! ( )
322
322
}
323
323
}
324
324
@@ -328,7 +328,7 @@ mod issue5435 {
328
328
where
329
329
Self : Sized ,
330
330
{
331
- unimplemented ! ( ) ;
331
+ unimplemented ! ( )
332
332
}
333
333
}
334
334
@@ -338,7 +338,7 @@ mod issue5435 {
338
338
where
339
339
Self : Sized ,
340
340
{
341
- unimplemented ! ( ) ;
341
+ unimplemented ! ( )
342
342
}
343
343
}
344
344
@@ -348,7 +348,7 @@ mod issue5435 {
348
348
where
349
349
Self : Sized ,
350
350
{
351
- unimplemented ! ( ) ;
351
+ unimplemented ! ( )
352
352
}
353
353
}
354
354
}
@@ -390,9 +390,7 @@ mod issue7344 {
390
390
391
391
impl < T > RetImplTraitSelf2 < T > {
392
392
// should not trigger lint
393
- fn new ( t : T ) -> impl Trait2 < ( ) , Self > {
394
- unimplemented ! ( )
395
- }
393
+ fn new ( t : T ) -> impl Trait2 < ( ) , Self > { }
396
394
}
397
395
398
396
struct RetImplTraitNoSelf2 < T > ( T ) ;
@@ -401,7 +399,6 @@ mod issue7344 {
401
399
// should trigger lint
402
400
fn new ( t : T ) -> impl Trait2 < ( ) , i32 > {
403
401
//~^ ERROR: methods called `new` usually return `Self`
404
- unimplemented ! ( )
405
402
}
406
403
}
407
404
0 commit comments