Skip to content

Stabilize unit tests with non-() return type #51298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libsyntax/test.rs
Original file line number Diff line number Diff line change
@@ -335,7 +335,7 @@ enum BadTestSignature {
fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
let has_test_attr = attr::contains_name(&i.attrs, "test");

fn has_test_signature(cx: &TestCtxt, i: &ast::Item) -> HasTestSignature {
fn has_test_signature(_cx: &TestCtxt, i: &ast::Item) -> HasTestSignature {
let has_should_panic_attr = attr::contains_name(&i.attrs, "should_panic");
match i.node {
ast::ItemKind::Fn(ref decl, _, _, _, ref generics, _) => {
@@ -394,9 +394,9 @@ fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
fn is_bench_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
let has_bench_attr = attr::contains_name(&i.attrs, "bench");

fn has_bench_signature(cx: &TestCtxt, i: &ast::Item) -> bool {
fn has_bench_signature(_cx: &TestCtxt, i: &ast::Item) -> bool {
match i.node {
ast::ItemKind::Fn(ref decl, _, _, _, ref generics, _) => {
ast::ItemKind::Fn(ref decl, _, _, _, _, _) => {
// NB: inadequate check, but we're running
// well before resolve, can't get too deep.
decl.inputs.len() == 1