-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
#[test] items are not being configured out in a non-test build #1126
Comments
It's probably intuitive to do this, but there are two reasons I didn't implement it.
|
Right, but writing |
This is why all of the tests in rustc live in #[cfg(test) mod test { ... }. As it stands, for 2 you can just grab the vector of tests and call std::test::run_tests, no extra work required. Furthermore, I hope to build more sophisticated test frameworks on top of this one and you'll want to be able to build the test without building the test runner (then use reflection to dig out the tests). But we can cross that bridge when it comes, and I'm not opposed to #[test] implying #[cfg(test)]. |
Well, seems you've thought this through. I don't think this is that important -- I just thought it looked like an oversight. Closing this issue. |
I'd like to leave it open. It's a worthy idea and it might yet be the right behavior. |
Finally changed my mind. Implemented in c2c497f. |
* Fix missing function check descriptions Co-authored-by: Zyad Hassan <[email protected]> Co-authored-by: Zyad Hassan <[email protected]>
They probably should. They could refer to things configured with #[cfg(test)], and will cause resolve errors when those are configured out.
The text was updated successfully, but these errors were encountered: