Skip to content

Correctly handle #[doc(alias = "...")] attribute on inlined reexports#153136

Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
GuillaumeGomez:reexport-doc-alias
Feb 28, 2026
Merged

Correctly handle #[doc(alias = "...")] attribute on inlined reexports#153136
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
GuillaumeGomez:reexport-doc-alias

Conversation

@GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Feb 26, 2026

Fixes #152939.

During the doc attributing migration to the new API, this information got lost. At least now we have a test for it. :)

r? @lolbinarycat

@rustbot rustbot added A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-search Area: Rustdoc's search feature 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 Feb 26, 2026
@lolbinarycat
Copy link
Contributor

  1. there's a bunch of other fields being discarded here, do we have tests ensuring we handle stuff like search_unbox and masked properly with re-exports?
  2. I kinda wish we could avoid .. here to force new fields to be handled explicitly, but at the same time there's so many fields so I understand that's not the most practical.
  3. As for the test, I think the filename for the inner an outer library should be different, just for clarity. Personally I would just add -inner to the filename of the auxiliary library.

@GuillaumeGomez
Copy link
Member Author

I agree with 1 and 2. As for 3, that's how we usually do: we give the same name as the test to the auxiliary one and rename it on import.

…l be forced to take them into account when inlining
@GuillaumeGomez
Copy link
Member Author

We already have a test for masked (tests/rustdoc-html/masked.rs). I added one for search_unbox. Remains the potential following ones:

  • fake_variadic
  • keyword
  • attribute
  • notable_trait

I'll open an issue once this PR is merged to check them and add a regression test if they don't have one already.

I also improved the code as you suggested (very good idea, love when code enforces that nothing is forgotten :3 ).

Does that sound ok to you @lolbinarycat ?

@rust-log-analyzer

This comment has been minimized.

@lolbinarycat
Copy link
Contributor

Everything looks good, addressing the rest of those in a followup sounds fine to me, just one final nit: reexport-search_unbox.js should have a comment explaining what it is testing.

Once that's fixed, you can r=me.

@GuillaumeGomez
Copy link
Member Author

Arf, forgot to add it indeed. Fixing that right away.

@lolbinarycat
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 27, 2026

📌 Commit ab9e1da has been approved by lolbinarycat

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 27, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 28, 2026
… r=lolbinarycat

Correctly handle `#[doc(alias = "...")]` attribute on inlined reexports

Fixes rust-lang#152939.

During the doc attributing migration to the new API, this information got lost. At least now we have a test for it. :)

r? @lolbinarycat
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 28, 2026
… r=lolbinarycat

Correctly handle `#[doc(alias = "...")]` attribute on inlined reexports

Fixes rust-lang#152939.

During the doc attributing migration to the new API, this information got lost. At least now we have a test for it. :)

r? @lolbinarycat
rust-bors bot pushed a commit that referenced this pull request Feb 28, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #153211 (`rust-analyzer` subtree update)
 - #149027 (Improve cross-crate trait impl param mismatch suggestions )
 - #152730 (add field representing types)
 - #153136 (Correctly handle `#[doc(alias = "...")]` attribute on inlined reexports)
 - #152165 (Normalize capture place `ty`s to prevent ICE)
 - #152615 (refactor 'valid for read/write' definition: exclude null)
 - #153109 (Fix LegacyKeyValueFormat report from docker build: aarch64-gnu-debug)
 - #153172 (Fix comment about placeholders)
 - #153187 (Fix ICE when macro-expanded extern crate shadows std)
 - #153190 (Don't allow subdiagnostic to use variables from their parent)
 - #153200 (Remove redundant clone)
 - #153216 (mark two polonius tests as known-bug)
@rust-bors rust-bors bot merged commit c3f1dab into rust-lang:main Feb 28, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Feb 28, 2026
rust-timer added a commit that referenced this pull request Feb 28, 2026
Rollup merge of #153136 - GuillaumeGomez:reexport-doc-alias, r=lolbinarycat

Correctly handle `#[doc(alias = "...")]` attribute on inlined reexports

Fixes #152939.

During the doc attributing migration to the new API, this information got lost. At least now we have a test for it. :)

r? @lolbinarycat
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Mar 2, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#153211 (`rust-analyzer` subtree update)
 - rust-lang/rust#149027 (Improve cross-crate trait impl param mismatch suggestions )
 - rust-lang/rust#152730 (add field representing types)
 - rust-lang/rust#153136 (Correctly handle `#[doc(alias = "...")]` attribute on inlined reexports)
 - rust-lang/rust#152165 (Normalize capture place `ty`s to prevent ICE)
 - rust-lang/rust#152615 (refactor 'valid for read/write' definition: exclude null)
 - rust-lang/rust#153109 (Fix LegacyKeyValueFormat report from docker build: aarch64-gnu-debug)
 - rust-lang/rust#153172 (Fix comment about placeholders)
 - rust-lang/rust#153187 (Fix ICE when macro-expanded extern crate shadows std)
 - rust-lang/rust#153190 (Don't allow subdiagnostic to use variables from their parent)
 - rust-lang/rust#153200 (Remove redundant clone)
 - rust-lang/rust#153216 (mark two polonius tests as known-bug)
@GuillaumeGomez GuillaumeGomez deleted the reexport-doc-alias branch March 2, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-search Area: Rustdoc's search feature S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

nightly regression: #[doc(alias)] does not resolve across crate re-imports

4 participants