@@ -73,7 +73,7 @@ struct T;
7373impl T {
7474 // should not trigger lint
7575 pub fn new ( ) -> Self {
76- unimplemented ! ( ) ;
76+ unimplemented ! ( )
7777 }
7878}
7979
@@ -83,7 +83,7 @@ impl U {
8383 // should trigger lint
8484 pub fn new ( ) -> u32 {
8585 //~^ ERROR: methods called `new` usually return `Self`
86- unimplemented ! ( ) ;
86+ unimplemented ! ( )
8787 }
8888}
8989
@@ -93,7 +93,7 @@ impl V {
9393 // should trigger lint
9494 pub fn new ( _: String ) -> u32 {
9595 //~^ ERROR: methods called `new` usually return `Self`
96- unimplemented ! ( ) ;
96+ unimplemented ! ( )
9797 }
9898}
9999
@@ -102,7 +102,7 @@ struct TupleReturnerOk;
102102impl TupleReturnerOk {
103103 // should not trigger lint
104104 pub fn new ( ) -> ( Self , u32 ) {
105- unimplemented ! ( ) ;
105+ unimplemented ! ( )
106106 }
107107}
108108
@@ -111,7 +111,7 @@ struct TupleReturnerOk2;
111111impl TupleReturnerOk2 {
112112 // should not trigger lint (it doesn't matter which element in the tuple is Self)
113113 pub fn new ( ) -> ( u32 , Self ) {
114- unimplemented ! ( ) ;
114+ unimplemented ! ( )
115115 }
116116}
117117
@@ -120,7 +120,7 @@ struct TupleReturnerOk3;
120120impl TupleReturnerOk3 {
121121 // should not trigger lint (tuple can contain multiple Self)
122122 pub fn new ( ) -> ( Self , Self ) {
123- unimplemented ! ( ) ;
123+ unimplemented ! ( )
124124 }
125125}
126126
@@ -130,7 +130,7 @@ impl TupleReturnerBad {
130130 // should trigger lint
131131 pub fn new ( ) -> ( u32 , u32 ) {
132132 //~^ ERROR: methods called `new` usually return `Self`
133- unimplemented ! ( ) ;
133+ unimplemented ! ( )
134134 }
135135}
136136
@@ -139,7 +139,7 @@ struct MutPointerReturnerOk;
139139impl MutPointerReturnerOk {
140140 // should not trigger lint
141141 pub fn new ( ) -> * mut Self {
142- unimplemented ! ( ) ;
142+ unimplemented ! ( )
143143 }
144144}
145145
@@ -148,7 +148,7 @@ struct ConstPointerReturnerOk2;
148148impl ConstPointerReturnerOk2 {
149149 // should not trigger lint
150150 pub fn new ( ) -> * const Self {
151- unimplemented ! ( ) ;
151+ unimplemented ! ( )
152152 }
153153}
154154
@@ -158,7 +158,7 @@ impl MutPointerReturnerBad {
158158 // should trigger lint
159159 pub fn new ( ) -> * mut V {
160160 //~^ ERROR: methods called `new` usually return `Self`
161- unimplemented ! ( ) ;
161+ unimplemented ! ( )
162162 }
163163}
164164
@@ -167,7 +167,7 @@ struct GenericReturnerOk;
167167impl GenericReturnerOk {
168168 // should not trigger lint
169169 pub fn new ( ) -> Option < Self > {
170- unimplemented ! ( ) ;
170+ unimplemented ! ( )
171171 }
172172}
173173
@@ -177,7 +177,7 @@ impl GenericReturnerBad {
177177 // should trigger lint
178178 pub fn new ( ) -> Option < u32 > {
179179 //~^ ERROR: methods called `new` usually return `Self`
180- unimplemented ! ( ) ;
180+ unimplemented ! ( )
181181 }
182182}
183183
@@ -186,7 +186,7 @@ struct NestedReturnerOk;
186186impl NestedReturnerOk {
187187 // should not trigger lint
188188 pub fn new ( ) -> ( Option < Self > , u32 ) {
189- unimplemented ! ( ) ;
189+ unimplemented ! ( )
190190 }
191191}
192192
@@ -195,7 +195,7 @@ struct NestedReturnerOk2;
195195impl NestedReturnerOk2 {
196196 // should not trigger lint
197197 pub fn new ( ) -> ( ( Self , u32 ) , u32 ) {
198- unimplemented ! ( ) ;
198+ unimplemented ! ( )
199199 }
200200}
201201
@@ -204,7 +204,7 @@ struct NestedReturnerOk3;
204204impl NestedReturnerOk3 {
205205 // should not trigger lint
206206 pub fn new ( ) -> Option < ( Self , u32 ) > {
207- unimplemented ! ( ) ;
207+ unimplemented ! ( )
208208 }
209209}
210210
@@ -215,7 +215,7 @@ struct WithLifetime<'a> {
215215impl < ' a > WithLifetime < ' a > {
216216 // should not trigger the lint, because the lifetimes are different
217217 pub fn new < ' b : ' a > ( s : & ' b str ) -> WithLifetime < ' b > {
218- unimplemented ! ( ) ;
218+ unimplemented ! ( )
219219 }
220220}
221221
@@ -236,7 +236,7 @@ mod issue5435 {
236236 impl TraitRet for StructRet {
237237 // should not trigger lint as we are in the impl block
238238 fn new ( ) -> String {
239- unimplemented ! ( ) ;
239+ unimplemented ! ( )
240240 }
241241 }
242242
@@ -252,7 +252,7 @@ mod issue5435 {
252252 where
253253 Self : Sized ,
254254 {
255- unimplemented ! ( ) ;
255+ unimplemented ! ( )
256256 }
257257 }
258258
@@ -262,7 +262,7 @@ mod issue5435 {
262262 where
263263 Self : Sized ,
264264 {
265- unimplemented ! ( ) ;
265+ unimplemented ! ( )
266266 }
267267 }
268268
@@ -272,15 +272,15 @@ mod issue5435 {
272272 where
273273 Self : Sized ,
274274 {
275- unimplemented ! ( ) ;
275+ unimplemented ! ( )
276276 }
277277 }
278278
279279 trait TupleReturnerBad {
280280 // should trigger lint
281281 fn new ( ) -> ( u32 , u32 ) {
282282 //~^ ERROR: methods called `new` usually return `Self`
283- unimplemented ! ( ) ;
283+ unimplemented ! ( )
284284 }
285285 }
286286
@@ -290,7 +290,7 @@ mod issue5435 {
290290 where
291291 Self : Sized ,
292292 {
293- unimplemented ! ( ) ;
293+ unimplemented ! ( )
294294 }
295295 }
296296
@@ -300,15 +300,15 @@ mod issue5435 {
300300 where
301301 Self : Sized ,
302302 {
303- unimplemented ! ( ) ;
303+ unimplemented ! ( )
304304 }
305305 }
306306
307307 trait MutPointerReturnerBad {
308308 // should trigger lint
309309 fn new ( ) -> * mut V {
310310 //~^ ERROR: methods called `new` usually return `Self`
311- unimplemented ! ( ) ;
311+ unimplemented ! ( )
312312 }
313313 }
314314
@@ -318,7 +318,7 @@ mod issue5435 {
318318 where
319319 Self : Sized ,
320320 {
321- unimplemented ! ( ) ;
321+ unimplemented ! ( )
322322 }
323323 }
324324
@@ -328,7 +328,7 @@ mod issue5435 {
328328 where
329329 Self : Sized ,
330330 {
331- unimplemented ! ( ) ;
331+ unimplemented ! ( )
332332 }
333333 }
334334
@@ -338,7 +338,7 @@ mod issue5435 {
338338 where
339339 Self : Sized ,
340340 {
341- unimplemented ! ( ) ;
341+ unimplemented ! ( )
342342 }
343343 }
344344
@@ -348,7 +348,7 @@ mod issue5435 {
348348 where
349349 Self : Sized ,
350350 {
351- unimplemented ! ( ) ;
351+ unimplemented ! ( )
352352 }
353353 }
354354}
@@ -390,9 +390,7 @@ mod issue7344 {
390390
391391 impl < T > RetImplTraitSelf2 < T > {
392392 // should not trigger lint
393- fn new ( t : T ) -> impl Trait2 < ( ) , Self > {
394- unimplemented ! ( )
395- }
393+ fn new ( t : T ) -> impl Trait2 < ( ) , Self > { }
396394 }
397395
398396 struct RetImplTraitNoSelf2 < T > ( T ) ;
@@ -401,7 +399,6 @@ mod issue7344 {
401399 // should trigger lint
402400 fn new ( t : T ) -> impl Trait2 < ( ) , i32 > {
403401 //~^ ERROR: methods called `new` usually return `Self`
404- unimplemented ! ( )
405402 }
406403 }
407404
0 commit comments