diff options
| author | Flavio Percoco Premoli <flaper87@gmail.com> | 2015-01-24 10:42:40 +0100 |
|---|---|---|
| committer | Flavio Percoco Premoli <flaper87@gmail.com> | 2015-01-24 10:42:40 +0100 |
| commit | 82299c07de8dea84d6fa5f02580ee49f04dd74dd (patch) | |
| tree | 610427c8fa81770a309219bf40cd0c30d476f7b5 /src/libsyntax | |
| parent | 65d14d2661bca8c6549d27b5d0bd81a8714f020b (diff) | |
| parent | fd029209ec4901580b1cc0180098e0b4024bee5b (diff) | |
| download | rust-82299c07de8dea84d6fa5f02580ee49f04dd74dd.tar.gz rust-82299c07de8dea84d6fa5f02580ee49f04dd74dd.zip | |
Rollup merge of #21504 - blackbeam:has_test_signature_fix, r=alexcrichton
Fix for `error: functions used as tests must have signature fn() -> ()` and `error: functions used as benches must have signature `fn(&mut Bencher) -> ()` in case of explicit return type declaration.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/test.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index e5d8e4e5143..8933d3a9669 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -295,6 +295,7 @@ fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool { &ast::ItemFn(ref decl, _, _, ref generics, _) => { let no_output = match decl.output { ast::DefaultReturn(..) => true, + ast::Return(ref t) if t.node == ast::TyTup(vec![]) => true, _ => false }; if decl.inputs.is_empty() @@ -331,6 +332,7 @@ fn is_bench_fn(cx: &TestCtxt, i: &ast::Item) -> bool { let input_cnt = decl.inputs.len(); let no_output = match decl.output { ast::DefaultReturn(..) => true, + ast::Return(ref t) if t.node == ast::TyTup(vec![]) => true, _ => false }; let tparm_cnt = generics.ty_params.len(); |
