-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Make doc stubs for builtin macros reflect existing support for trailing commas #46260
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @kennytm (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
These definitions have been wrong so many times... it would be great if there were a way to test them. |
You should probably also update the duplicate definitions in libcore (the existence of which is also unfortunate). |
Ping from triage @steveklabnik — it's been over 3 days and we haven't heard from you :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! this is great.
@bors: r+ rollup |
📌 Commit 31b8a15 has been approved by |
…veklabnik Make doc stubs for builtin macros reflect existing support for trailing commas This modifies the `macro_rules!` stubs in `std` for some of the compiler builtin macros in order to better reflect their currently supported grammar. To my understanding these stubs have no impact on compiler output whatsoever, and only exist so that they may appear in the documentation. P.S. It is in fact true that `env!` supports trailing commas while `option_env!` currently does not. (I have another issue for this) I don't imagine there's any way to automatically test these stubs, but I did *informally* test the new definitions on the playpen to see that they accept the desired invocations, as well as inspect the updated doc output.
This modifies the
macro_rules!
stubs instd
for some of the compiler builtin macros in order to better reflect their currently supported grammar. To my understanding these stubs have no impact on compiler output whatsoever, and only exist so that they may appear in the documentation.P.S. It is in fact true that
env!
supports trailing commas whileoption_env!
currently does not. (I have another issue for this)I don't imagine there's any way to automatically test these stubs, but I did informally test the new definitions on the playpen to see that they accept the desired invocations, as well as inspect the updated doc output.