-
Notifications
You must be signed in to change notification settings - Fork 13.3k
unit testing improperly ignores test funs that take args #4391
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
Labels
A-frontend
Area: Compiler frontend (errors, parsing and HIR)
Comments
Indeed; we are already issuing a fatal error when someone tries to insert an unsafe function, so other kinds of mismatches seem plausible to me. I think all of the relevant code here is contained within |
just a bug, de-milestoning. |
bors
added a commit
that referenced
this issue
May 2, 2013
…ly-skip-erroneous-tests, r=pnkfelix ...e. Fixes #4391.
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Jan 17, 2021
Sander Maijers reports that #[test] functions that return a `Result` with a named lifetime fail to compile with a "functions used as tests must have signature fn() -> ()" error message—but that can't really be right, because #[test] functions that return a `Result` with a static lifetime are accepted! It turns out that this error message dates all the way back to April 2013's 5f1a90e ("Issue 4391: rustc should not silently skip tests with erroneous signature."). But after RFC 1937, we actually do accept non-unit return types in tests. Let's edit the error message accordingly. This resolves rust-lang#55228, and is of historical interest to rust-lang#4391.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First bug report submitted using github: apologies in advance for any #githubfail :
It appears to me that the unit testing framework silently ignores functions marked #[test] that accept an argument.
Here's the file:
here's the transcript of running this:
I would have expected either a compile-time error or a failed test. A compile-time error, really.
The text was updated successfully, but these errors were encountered: