-
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
Empty doc tests should be linted #60319
Comments
This error was removed in #60140 because I didn't think it could actually be produced. Looks like it was possible to trigger by writing an empty doc test. The error message is misleading, though. It's a valid code block, just empty. On master, this code produces a passing doc test now. IMO, that is the correct behavior. There should probably be a test for it. |
I agree completely. Would this mean re-introducing this message but improving the message (replacing invalid with empty or something similar)? I believe that is the best course of action as warning on an empty code block is completely valid and desired IMO. |
The original code only caught this incidentally. I think this check would make more sense as a rustdoc lint instead of a hard warning. Could be added to |
@phrohdoh could you edit this issue to reflect the current status? It should be something like "Empty doc tests should be linted". |
Run tests for https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=8ac29ea8121d53906e7a77cd01ccbe70 and you'll get the following diagnostic:
But to be as helpful as possible the diagnostic should, if possible, point to the start of the invalid code block.
The text was updated successfully, but these errors were encountered: