Skip to content

resolve: Make disambiguators for underscore bindings module-local (take 2) #144272

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

Merged
merged 2 commits into from
Jul 24, 2025

Conversation

petrochenkov
Copy link
Contributor

The difference with #144013 can be seen in the second commit.

Now we just keep a separate disambiguator counter in every Module, instead of a global counter in Resolver.
This will be ok for parallel import resolution because we'll need to lock the module anyway when updating resolutions and other fields in it.
And for external modules the disabmiguator could be just passed as an argument to define_extern, without using any cells or locks, once #143884 lands.

Unblocks #143884.

@rustbot
Copy link
Collaborator

rustbot commented Jul 21, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
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

@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 Jul 21, 2025
@petrochenkov
Copy link
Contributor Author

r? @oli-obk as the reviewer of #144013

@rustbot rustbot assigned oli-obk and unassigned davidtwco Jul 22, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Jul 22, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 22, 2025

📌 Commit e94b3da has been approved by oli-obk

It is now in the queue for this repository.

@bors bors 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 Jul 22, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 22, 2025
resolve: Make disambiguators for underscore bindings module-local (take 2)

The difference with rust-lang#144013 can be seen in the second commit.

Now we just keep a separate disambiguator counter in every `Module`, instead of a global counter in `Resolver`.
This will be ok for parallel import resolution because we'll need to lock the module anyway when updating `resolutions` and other fields in it.
And for external modules the disabmiguator could be just passed as an argument to `define_extern`, without using any cells or locks, once rust-lang#143884 lands.

Unblocks rust-lang#143884.
bors added a commit that referenced this pull request Jul 22, 2025
Rollup of 8 pull requests

Successful merges:

 - #144094 (Ensure we codegen the main fn)
 - #144173 (Remove tidy checks for `tests/ui/issues/`)
 - #144218 (Use serde for target spec json deserialize)
 - #144221 (generate elf symbol version in raw-dylib)
 - #144234 (Fix broken TLS destructors on 32-bit win7)
 - #144256 (Don't ICE on non-TypeId metadata within TypeId)
 - #144272 (resolve: Make disambiguators for underscore bindings module-local (take 2))
 - #144276 (Use less HIR in check_private_in_public.)

r? `@ghost`
`@rustbot` modify labels: rollup
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 23, 2025
resolve: Make disambiguators for underscore bindings module-local (take 2)

The difference with rust-lang#144013 can be seen in the second commit.

Now we just keep a separate disambiguator counter in every `Module`, instead of a global counter in `Resolver`.
This will be ok for parallel import resolution because we'll need to lock the module anyway when updating `resolutions` and other fields in it.
And for external modules the disabmiguator could be just passed as an argument to `define_extern`, without using any cells or locks, once rust-lang#143884 lands.

Unblocks rust-lang#143884.
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 23, 2025
resolve: Make disambiguators for underscore bindings module-local (take 2)

The difference with rust-lang#144013 can be seen in the second commit.

Now we just keep a separate disambiguator counter in every `Module`, instead of a global counter in `Resolver`.
This will be ok for parallel import resolution because we'll need to lock the module anyway when updating `resolutions` and other fields in it.
And for external modules the disabmiguator could be just passed as an argument to `define_extern`, without using any cells or locks, once rust-lang#143884 lands.

Unblocks rust-lang#143884.
@matthiaskrgr
Copy link
Member

@bors r-
think this failed here: #144325 (comment)

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 23, 2025
@petrochenkov
Copy link
Contributor Author

@bors r- think this failed here: #144325 (comment)

I cannot reproduce this locally neither on Windows, nor on Linux.

@petrochenkov
Copy link
Contributor Author

@bors try jobs=x86_64-apple-1

@rust-bors
Copy link

rust-bors bot commented Jul 23, 2025

⌛ Trying commit 698fba9 with merge eba26fd

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 23, 2025
resolve: Make disambiguators for underscore bindings module-local (take 2)

try-job: x86_64-apple-1
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 23, 2025

💔 Test failed (CI). Failed jobs:

@LorrensP-2158466
Copy link
Contributor

I cannot reproduce this locally neither on Windows, nor on Linux.

I have a Mac M1. I can try and use Rosetta if you think that would help.

@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor Author

petrochenkov commented Jul 23, 2025

The CI run on x86_64-apple-1 above didn't show the same error as in #144325 (comment), the "Building compiler artifacts (stage0 -> stage1, x86_64-apple-darwin)" step passed successfully.

I'll remove the debugging commit and r+ this again with rollup=never.

@petrochenkov
Copy link
Contributor Author

I cannot reproduce this locally neither on Windows, nor on Linux.

I have a Mac M1. I can try and use Rosetta if you think that would help.

If you can reproduce the failure from #144325 (comment), it would be helpful, even if it's not related to this PR.

@LorrensP-2158466
Copy link
Contributor

If you can reproduce the failure from #144325 (comment), it would be helpful, even if it's not related to this PR.

If it's not related, it would be too much of a hassle. I will have to install all x86_64 Apple packages that are used by Rust. That will take too much space and time 😆.

@petrochenkov
Copy link
Contributor Author

@bors r=oli-obk rollup=never

@bors
Copy link
Collaborator

bors commented Jul 23, 2025

📌 Commit 4b55791 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 23, 2025
@bors
Copy link
Collaborator

bors commented Jul 24, 2025

⌛ Testing commit 4b55791 with merge fc5af18...

@bors
Copy link
Collaborator

bors commented Jul 24, 2025

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing fc5af18 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 24, 2025
@bors bors merged commit fc5af18 into rust-lang:master Jul 24, 2025
12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 24, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 3c30dbb (parent) -> fc5af18 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard fc5af1813307d25a84d633f21e2e53c9376eb547 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-apple-various: 5640.3s -> 8446.7s (49.8%)
  2. dist-aarch64-apple: 5827.1s -> 7014.0s (20.4%)
  3. tidy: 102.7s -> 123.6s (20.3%)
  4. pr-check-2: 2671.2s -> 2141.4s (-19.8%)
  5. dist-x86_64-apple: 11237.3s -> 9040.1s (-19.6%)
  6. x86_64-rust-for-linux: 2915.1s -> 2539.6s (-12.9%)
  7. x86_64-gnu-llvm-19: 2827.5s -> 2506.2s (-11.4%)
  8. dist-various-1: 3934.9s -> 4292.5s (9.1%)
  9. i686-gnu-1: 8189.3s -> 7454.9s (-9.0%)
  10. x86_64-gnu-tools: 3694.3s -> 3365.6s (-8.9%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fc5af18): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.4% [0.1%, 0.7%] 17
Regressions ❌
(secondary)
0.3% [0.0%, 0.6%] 21
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.1%, 0.7%] 17

Max RSS (memory usage)

Results (secondary -1.1%)

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)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-3.1%, -2.6%] 2
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 468.586s -> 468.258s (-0.07%)
Artifact size: 374.68 MiB -> 374.68 MiB (-0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. 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.

9 participants