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

Rustdoc should emit macro documentation #9954

Closed
orenbenkiki opened this issue Oct 19, 2013 · 4 comments
Closed

Rustdoc should emit macro documentation #9954

orenbenkiki opened this issue Oct 19, 2013 · 4 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@orenbenkiki
Copy link

It is now possible to add attributes to macros, so it is possible to add documentation to each one. The rustdoc tool should emit the macro documentation in a "MACROS" section (probably just before the "FUNCTIONS" section).

@alexcrichton
Copy link
Member

This is a little tricky because all macros are lost after crate expansion. This would probably involve leaving behind sentinel values which are ignored for the rest of compilation, but remain to have the documentation.

There's also the matter of what the documentation should show, and it should probably show the patterns for which the macro is defined (not just the name of the macro), and this is a bit tricky as well. Just things to consider though, don't mean to stop any progress on this!

It would be awesome to have std::macros define all the macros defined by the compiler so they could actually all be documented in one place!

@huonw
Copy link
Member

huonw commented Jan 17, 2014

We now have exportable macros, so being able to document them is important.

@huonw
Copy link
Member

huonw commented Jan 17, 2014

Also, cc #3163.

@sfackler
Copy link
Member

Exported macro definitions are now left in the AST after expansion, so this should be easier.

flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 1, 2022
Don't lint `unnecessary_operation` in mixed macro contexts

fixes rust-lang#9954

changelog: `unnecessary_operation`: Don't lint in mixed macro contexts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants