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

repair macro docs #15751

Closed
wants to merge 1 commit into from
Closed

Conversation

jbclements
Copy link
Contributor

In f1ad425, I changed the handling
of macros, to prevent macro invocations from occurring in fully expanded
source. Instead, I added a side table. It contained only the
spans of the macros, because this was the only information required
in order to make macro export work.

However, librustdoc was also affected by this change, since it
extracts macro information in a similar way. As a result of the earlier
change, exported macros were no longer documented.

In order to repair this, I've adjusted the side table to contain whole
items, rather than just the spans.

Note that the resulting macro documentation now appears at the
top level of the crate.

Fixes #15645

@emberian
Copy link
Member

Appearing at the toplevel isn't as nice since std::macros will be floating. But until import/export is worked out, it's probably fine...

@lilyball
Copy link
Contributor

Note that the resulting macro documentation now appears at the
top level of the crate.

Won't that still break the std::macros documentation?

@emberian
Copy link
Member

r+ retracted. @jbclements travis failed with a legit fold_mac error in stdtest

@sfackler
Copy link
Member

It seems like the easy solution is to just tack on #[doc(hidden)] to std::macros.

@jbclements
Copy link
Contributor Author

ha! funny! hoist by my own petard. These are the checks that I added to make sure that no macros are left in the crate after expansion. But this patch does stow those macros in the crate. I'm just going to tweak fold_crate, a bit.

bors added a commit that referenced this pull request Jul 19, 2014
In f1ad425, I changed the handling
of macros, to prevent macro invocations from occurring in fully expanded
source. Instead, I added a side table. It contained only the
spans of the macros, because this was the only information required
in order to make macro export work.

However, librustdoc was also affected by this change, since it
extracts macro information in a similar way. As a result of the earlier
change, exported macros were no longer documented.

In order to repair this, I've adjusted the side table to contain whole
items, rather than just the spans.

Note that the resulting macro documentation now appears at the
top level of the crate.
In f1ad425, I changed the handling
of macros, to prevent macro invocations from occurring in fully expanded
source. Instead, I added a side table. It contained only the
spans of the macros, because this was the only information required
in order to make macro export work.

However, librustdoc was also affected by this change, since it
extracts macro information in a similar way. As a result of the earlier
change, exported macros were no longer documented.

In order to repair this, I've adjusted the side table to contain whole
items, rather than just the spans.
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.

Macros not visible in documentation
4 participants