Skip to content

Fix rustdoc not correctly showing attributes on re-exports #143083

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonathanBrouwer
Copy link
Contributor

Fixes attributes not being shown correctly in rustdoc on re-exports

Does this need to be backported to beta?

r? @jdonszelmann

@rustbot
Copy link
Collaborator

rustbot commented Jun 27, 2025

jdonszelmann is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jun 27, 2025
@JonathanBrouwer JonathanBrouwer changed the title Fix rustdoc not correctly showing attributes with re-exports Fix rustdoc not correctly showing attributes on re-exports Jun 27, 2025
Copy link
Contributor

@lolbinarycat lolbinarycat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe could use a comment on the test, but I think its simple enough to be self-explanatory.

I've looked through AttributeKind and there's nothing there that seems like it should be hidden only when an item is inlined, with the possible exception of doc(inline) itself, although the code suggests that the doc attribute isn't using the new attribute parsing system yet.

@JonathanBrouwer
Copy link
Contributor Author

JonathanBrouwer commented Jun 27, 2025

@lolbinarycat
I've added a comment to the test.

I've matched the fixed behaviour exactly to the old behaviour, which is right above the changed lines.
In the old behaviour, only cfg_trace is excluded. cfg_trace has not been converted to the new attribute parser yet so that's why I put a FIXME in place

@fmease fmease assigned fmease and unassigned jdonszelmann Jun 27, 2025
@lolbinarycat
Copy link
Contributor

In the old behaviour, only cfg_trace is excluded

both doc and cfg_trace have special handling, and both of them will need that special handling ported to the new system when they are ported to the new system, but that's an issue for a future PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants