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

Allow doc-strings on item macros #3163

Closed
eholk opened this issue Aug 9, 2012 · 8 comments
Closed

Allow doc-strings on item macros #3163

eholk opened this issue Aug 9, 2012 · 8 comments
Labels
A-syntaxext Area: Syntax extensions T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@eholk
Copy link
Contributor

eholk commented Aug 9, 2012

Some of our libraries are starting to export protocols. It'd be nice to be able to add documentation to these that gets included in the Rustdocs.

I don't know if it's better to document it as a macro invocation, or as documentation on whatever the macro expands to. For protocols, both makes sense, although documenting the unexpanded version is probably more useful to the user.

@catamorphism
Copy link
Contributor

far-future

@bblum
Copy link
Contributor

bblum commented Aug 5, 2013

Also useful for conditions, now that protocols have been put on indefinite ice.

@emberian
Copy link
Member

Macros are no longer present in the AST (are they ever present? I see an item_mac) when rustdoc_ng visits it.

/cc @jbclements @paulstansifer

@paulstansifer
Copy link
Contributor

@cmr They are expanded away by macro expansion... should rustdoc_ng expand macros? I'm afraid that the answer might be complicated.

@emberian
Copy link
Member

@paulstansifer rustdoc_ng expands macros because there are modules that need documenting that are generated by macros (specifically std::f32 etc)

@paulstansifer
Copy link
Contributor

@cmr That makes sense. In theory, it could also make sense to have only documentation for all of the generated modules as a whole (after all, the text will always be the same)... but cross-referencing and various edge cases might make that very tricky.

@emberian
Copy link
Member

@paulstansifer Could I parse, pull out the item_mac's, and then continue with the rest of the compilation pipeline? Since they are purely disjoint from the final AST I get I don't see any problems with it.

@paulstansifer
Copy link
Contributor

@cmr I don't see any reason why that couldn't work.

saethlin pushed a commit to saethlin/rust that referenced this issue Nov 17, 2023
don't expose all the borrow tracker stuff to the entire crate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntaxext Area: Syntax extensions 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

5 participants