Skip to content

resolve: Make sure visibilities of import declarations make sense#155213

Open
petrochenkov wants to merge 2 commits intorust-lang:mainfrom
petrochenkov:importvis
Open

resolve: Make sure visibilities of import declarations make sense#155213
petrochenkov wants to merge 2 commits intorust-lang:mainfrom
petrochenkov:importvis

Conversation

@petrochenkov
Copy link
Copy Markdown
Contributor

That they are all ordered inside the module and not more private than the module itself.

The import_decl_vis logic is also reused when reporting ambiguous_import_visibilities lint.
Some asserts are hardened.
Some relevant tests are added.

Extracted from #154149.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 12, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 12, 2026

r? @jdonszelmann

rustbot has assigned @jdonszelmann.
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 69 candidates
  • Random selection from 11 candidates

@petrochenkov
Copy link
Copy Markdown
Contributor Author

cc @yaahc

@petrochenkov
Copy link
Copy Markdown
Contributor Author

To make sure the asserts are not expensive.
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Apr 12, 2026
resolve: Make sure visibilities of import declarations make sense
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 12, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 12, 2026

☀️ Try build successful (CI)
Build commit: 89a90f3 (89a90f39ff9b6aadf1ca3a80a26c38deb2592682, parent: 14196dbfa3eb7c30195251eac092b1b86c8a2d84)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (89a90f3): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary 1.5%, secondary -6.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.7% [-6.7%, -6.7%] 1
All ❌✅ (primary) 1.5% [1.5%, 1.5%] 1

Cycles

Results (primary -2.6%, secondary 11.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
11.4% [2.7%, 25.8%] 3
Improvements ✅
(primary)
-2.6% [-3.0%, -2.3%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.6% [-3.0%, -2.3%] 2

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 491.114s -> 490.825s (-0.06%)
Artifact size: 394.23 MiB -> 394.30 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 12, 2026
@rust-bors

This comment has been minimized.

That they are all ordered inside the module and not more private than the module itself
The `import_decl_vis` logic is reused when reporting `ambiguous_import_visibilities` lint
Some asserts are hardened
Some relevant tests are added
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 14, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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-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.

4 participants