Skip to content

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
Contributor

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
Contributor

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.
@ghost ghost mentioned this pull request Jul 20, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 16, 2025
Some methods lints were handled in the `methods` module outside the
`check_methods()` function.

changelog: none
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