@@ -328,7 +328,7 @@ enum BadTestSignature {
328
328
NotEvenAFunction ,
329
329
WrongTypeSignature ,
330
330
NoArgumentsAllowed ,
331
- ShouldPanicOnlyWithNoArgs
331
+ ShouldPanicOnlyWithNoArgs ,
332
332
}
333
333
334
334
fn is_test_fn ( cx : & TestCtxt , i : & ast:: Item ) -> bool {
@@ -347,7 +347,7 @@ fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
347
347
} ;
348
348
349
349
if !decl. inputs . is_empty ( ) {
350
- return No ( BadTestSignature :: NoArgumentsAllowed )
350
+ return No ( BadTestSignature :: NoArgumentsAllowed ) ;
351
351
}
352
352
353
353
match ( has_output, cx. features . termination_trait_test , has_should_panic_attr) {
@@ -359,7 +359,6 @@ fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
359
359
} ,
360
360
( true , false , _) => No ( BadTestSignature :: WrongTypeSignature ) ,
361
361
( false , _, _) => Yes
362
-
363
362
}
364
363
}
365
364
_ => No ( BadTestSignature :: NotEvenAFunction ) ,
@@ -375,11 +374,14 @@ fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
375
374
BadTestSignature :: NotEvenAFunction =>
376
375
diag. span_err ( i. span , "only functions may be used as tests" ) ,
377
376
BadTestSignature :: WrongTypeSignature =>
378
- diag. span_err ( i. span , "functions used as tests must have signature fn() -> ()" ) ,
377
+ diag. span_err ( i. span ,
378
+ "functions used as tests must have signature fn() -> ()" ) ,
379
379
BadTestSignature :: NoArgumentsAllowed =>
380
380
diag. span_err ( i. span , "functions used as tests can not have any arguments" ) ,
381
381
BadTestSignature :: ShouldPanicOnlyWithNoArgs =>
382
- diag. span_err ( i. span , "test functions returning Result<> must not use #[should_panic]" ) ,
382
+ diag. span_err ( i. span ,
383
+ "functions used as tests returning Result<_, _> must \
384
+ not use #[should_panic]") ,
383
385
}
384
386
false
385
387
}
@@ -420,7 +422,7 @@ fn is_bench_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
420
422
// well before resolve, can't get too deep.
421
423
input_cnt == 1 && output_matches
422
424
}
423
- _ => false
425
+ _ => false
424
426
}
425
427
}
426
428
0 commit comments