Skip to content
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

Generate doc comment on benchmark runner in criterion_group macro #774

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mcskware
Copy link

tl;dr: One-liner to add a doc comment to the generated benchmark runner fn from the criterion_group! macro.

The rustc lint missing-docs is triggered when using the criterion_group! macro. For users who specify the lint on their rustc command line, this can generate a warning that they are unable to quiet without an inner allow attribute (e.g. using #![allow(missing-docs)] at the head of their source file). This will surpress any other missing docs in their own code, which may be unexpected behavior.

I don't see any real downsides to this change, but I'm brand new to the criterion.rs codebase. Comments, discussion, and suggestions very welcome on this proposed change. For instance, I have no idea if this change warrants an entry in the changelog. Cheers!

@mcskware
Copy link
Author

If there are any suggestions for what the generated comment should read, I'm happy to change that. The comment won't in general be visible, of course, but will show up when a user expands the macro. The current comment simply reads "The function which runs the benchmarks."

@waywardmonkeys waywardmonkeys mentioned this pull request Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant