Skip to content

Add regression test for cross-crate assoc const private field leak in rustdoc - #160748

Open
zakrad wants to merge 1 commit into
rust-lang:mainfrom
zakrad:regr-test-99630
Open

Add regression test for cross-crate assoc const private field leak in rustdoc#160748
zakrad wants to merge 1 commit into
rust-lang:mainfrom
zakrad:regr-test-99630

Conversation

@zakrad

@zakrad zakrad commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closes #99630 adds a rustdoc test, reexporting a type must not leak the private field

@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 Aug 8, 2026
@rustbot

rustbot commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: rustdoc
  • rustdoc expanded to 8 candidates
  • Random selection from GuillaumeGomez, camelid, lolbinarycat, notriddle

extern crate assoc_const_private_fields;

//@ has foo/struct.HasPrivateFields.html
//@ has - '//*[@id="associatedconstant.ASSOC"]' 'pub const ASSOC: HasPrivateFields'

@GuillaumeGomez GuillaumeGomez Aug 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you use a regex instead to ensure it's the entire content and not just a sub-part? So you use ^ at the start and $ at the end to ensure it's the full content.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for hint, switched to regex


//@ has foo/struct.HasPrivateFields.html
//@ has - '//*[@id="associatedconstant.ASSOC"]' 'pub const ASSOC: HasPrivateFields'
//@ !has - '//*[@id="associatedconstant.ASSOC"]' '_private'

@GuillaumeGomez GuillaumeGomez Aug 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Once updated to the regex, please remove this check.

View changes since the review

@GuillaumeGomez

Copy link
Copy Markdown
Member

Thanks! r=me once CI pass.

@bors delegate+

@rust-bors

rust-bors Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

✌️ @zakrad, you can now approve this pull request!

If @GuillaumeGomez told you to "r=me" after making some further change, then please make that change and post @bors r=GuillaumeGomez.

View changes since this delegation.

@zakrad

zakrad commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=GuillaumeGomez

@rust-bors

rust-bors Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1a04912 has been approved by GuillaumeGomez

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 Aug 8, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 9, 2026
…eGomez

Add regression test for cross-crate assoc const private field leak in rustdoc

Closes rust-lang#99630 adds a rustdoc test, reexporting a type must not leak the private field
rust-bors Bot pushed a commit that referenced this pull request Aug 9, 2026
Rollup of 6 pull requests

Successful merges:

 - #160529 (Upgrade and deduplicate dependencies)
 - #158517 (Initial implementation of named `Fn` trait parameters)
 - #158587 (check if len of array const arg matches the expected len of the type when lowering to valtree)
 - #160748 (Add regression test for cross-crate assoc const private field leak in rustdoc)
 - #160708 (remove old update mechanism)
 - #160768 (Fix autodiff_illegal.rs test)
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 9, 2026
…eGomez

Add regression test for cross-crate assoc const private field leak in rustdoc

Closes rust-lang#99630 adds a rustdoc test, reexporting a type must not leak the private field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Rustdoc displays private internals of associated constants when reexporting types

3 participants