-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Doctests don't run on nonexported macro_rules!
macros
#88038
Comments
I think we should just change this; it's no different than #66059 in that the code was already broken before and we just didn't happen to run it. If you're really worried we can do a crater run but I would honestly be ok with just landing this. |
@rustbot label +E-easy +E-mentor |
Looks like #88019 accidentally prevented these doctests from being run even if |
@rustbot claim |
Include nonexported macro_rules! macros in the doctest target Fixes rust-lang#88038 This PR aims to include nonexported `macro_rules!` macros in the doctest target. For more details, please see the above issue.
FYI, rayon has an internal macro with an example that wasn't ready to be treated as a test: ... discovered by failing in a CI run. |
Hmm, I'm not even sure how to turn that into a working doctest, because the macro isn't exported. The |
At present, doctests aren't run on
macro_rules!
macros that are not annotated with#[macro_export]
. After #88019, it will become possible to fix this problem. However, doing so will cause tests to run that were skipped previously to run, which will likely cause test failures and may mess up people's CI. It might be helpful to provide some form of warning period first.The relevant code is here:
rust/src/librustdoc/doctest.rs
Lines 1175 to 1184 in 5eacec9
Fixing this issue technically just requires removing that special case. However, things are complicated by the fact that this will cause people's tests to suddenly fail. I'm not really sure how we should handle that. @jyn514, do you have any ideas?
The text was updated successfully, but these errors were encountered: