-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: memoize pub use
-reexported macros so they don't appear twice in docs
#40814
Conversation
I don't have a test for this because I don't have a clue where to start writing one. run-make + grep again? |
This looks correct but seems like a step in the wrong direction w.r.t. complexity. Could we get instead get rid of this block entirely so that macro re-exports are not inlined by default and then push to I believe that would be equivalent, except that
|
The second option sounds like it'll require more complexity and touch more code, and I was hesitant to break documentation for Perhaps we can fix the issue first, then deprecate |
"the first option" being your suggested changes; I just don't like the idea of breaking documentation for |
Ok, makes sense. I still prefer the second option, but this is fine for now, especially since we can switch to the first option when removing I think you can write a r=me with a test |
The second option isn't horrible I guess, I just don't like touching Resolver for a short-term fix. It feels like it's leaking the scope of the fix. |
☔ The latest upstream changes (presumably #40826) made this pull request unmergeable. Please resolve the merge conflicts. |
pub use
'd macros from the export mappub use
-reexported macros so they don't appear twice in docs
@jseyfried New solution + test. I think you'll like it better than before. |
I've also added some blank lines in places because it makes those bits easier to read. |
src/librustdoc/visit_ast.rs
Outdated
|
||
self.reexported_macros.insert(did); | ||
|
||
return false; |
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.
I could probably condense this block though, it looks weird in review.
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.
I'd probably condense, but up to you.
@abonander I do like this solution more :) |
✌️ @abonander can now approve this pull request |
📌 Commit 9339522 has been approved by |
@bors r=jseyfried |
📌 Commit d8fc5b8 has been approved by |
Rustdoc: memoize `pub use`-reexported macros so they don't appear twice in docs Closes rust-lang#39436 Preserves existing behavior for `#[macro_reexport]`. `pub use`'d macros are shown as reexports unless inlined, and also correctly obey `#[doc(hidden)]`. r? @jseyfried cc @SergioBenitez
Rustdoc: memoize `pub use`-reexported macros so they don't appear twice in docs Closes rust-lang#39436 Preserves existing behavior for `#[macro_reexport]`. `pub use`'d macros are shown as reexports unless inlined, and also correctly obey `#[doc(hidden)]`. r? @jseyfried cc @SergioBenitez
Closes #39436
Preserves existing behavior for
#[macro_reexport]
.pub use
'd macros are shown as reexports unless inlined, and also correctly obey#[doc(hidden)]
.r? @jseyfried
cc @SergioBenitez