Skip to content

Fix order-dependent visibility diagnostics#155948

Open
SynapLink wants to merge 1 commit intorust-lang:mainfrom
SynapLink:fix/pub-visibility-order
Open

Fix order-dependent visibility diagnostics#155948
SynapLink wants to merge 1 commit intorust-lang:mainfrom
SynapLink:fix/pub-visibility-order

Conversation

@SynapLink
Copy link
Copy Markdown
Contributor

@SynapLink SynapLink commented Apr 28, 2026

View all comments

Fixes #40066.
Fixes #109657.
Delay visibility path diagnostics until module collection has finished, so paths to later non-ancestor modules report E0742 instead of an unresolved path error.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 28, 2026
@rust-log-analyzer

This comment has been minimized.

@SynapLink SynapLink force-pushed the fix/pub-visibility-order branch from bfb4b8a to 21b1458 Compare April 28, 2026 23:08
@SynapLink SynapLink marked this pull request as ready for review April 29, 2026 00:19
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 29, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 29, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 29, 2026

r? @mu001999

rustbot has assigned @mu001999.
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: compiler
  • compiler expanded to 73 candidates
  • Random selection from 20 candidates

@petrochenkov petrochenkov self-assigned this Apr 29, 2026
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 29, 2026
@SynapLink SynapLink force-pushed the fix/pub-visibility-order branch from 21b1458 to 4f56ffe Compare April 29, 2026 17:51
@SynapLink
Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 29, 2026
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
@SynapLink SynapLink force-pushed the fix/pub-visibility-order branch from 4f56ffe to 843b87b Compare April 30, 2026 07:20
Comment thread compiler/rustc_resolve/src/diagnostics.rs Outdated
Comment thread compiler/rustc_resolve/src/diagnostics.rs Outdated
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 30, 2026
@SynapLink SynapLink force-pushed the fix/pub-visibility-order branch from 843b87b to f7c62f5 Compare April 30, 2026 18:52
@SynapLink
Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 30, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

Thanks!
@bors r=petrochenkov,mu001999

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 1, 2026

📌 Commit f7c62f5 has been approved by petrochenkov,mu001999

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 May 1, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 1, 2026
…, r=petrochenkov,mu001999

Fix order-dependent visibility diagnostics

Fixes rust-lang#40066.
Fixes rust-lang#109657.
Delay visibility path diagnostics until module collection has finished, so paths to later non-ancestor modules report E0742 instead of an unresolved path error.
jhpratt added a commit to jhpratt/rust that referenced this pull request May 1, 2026
…, r=petrochenkov,mu001999

Fix order-dependent visibility diagnostics

Fixes rust-lang#40066.
Fixes rust-lang#109657.
Delay visibility path diagnostics until module collection has finished, so paths to later non-ancestor modules report E0742 instead of an unresolved path error.
rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
Rollup of 6 pull requests

Successful merges:

 - #149637 (Do not run jump-threading for GPUs)
 - #155948 (Fix order-dependent visibility diagnostics)
 - #155600 (Adds a couple UI tests for polonius)
 - #155995 (-Zembed-source: also embed external source)
 - #156019 (Feed cleanups)
 - #156031 (Return a single diagnostic from `lex_token_trees`.)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 1, 2026
…, r=petrochenkov,mu001999

Fix order-dependent visibility diagnostics

Fixes rust-lang#40066.
Fixes rust-lang#109657.
Delay visibility path diagnostics until module collection has finished, so paths to later non-ancestor modules report E0742 instead of an unresolved path error.
rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #149637 (Do not run jump-threading for GPUs)
 - #154971 (Verify that penultimate segment of enum variant path refers to enum if it has args)
 - #155186 (Avoid loop_match self-assignment in MIR lowering)
 - #155948 (Fix order-dependent visibility diagnostics)
 - #156001 (ssa-range-prop: fix ICE when encountering self-domiating bb)
 - #155600 (Adds a couple UI tests for polonius)
 - #155995 (-Zembed-source: also embed external source)
 - #156019 (Feed cleanups)
 - #156031 (Return a single diagnostic from `lex_token_trees`.)
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unexpected behavior of pub(in other_module) Error on bad pub(path) depends on module ordering

5 participants