Skip to content
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

Return an indexmap in all_local_trait_impls query #93312

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

pierwill
Copy link
Member

@pierwill pierwill commented Jan 25, 2022

The data structure previously used here required that DefId be Ord. As part of #90317, we do not want DefId to implement Ord.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 25, 2022
@rust-highfive
Copy link
Collaborator

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 25, 2022
@pierwill pierwill force-pushed the map-all-local-trait-impls branch 2 times, most recently from 1390750 to 7e21dc3 Compare January 25, 2022 23:21
@rust-log-analyzer

This comment has been minimized.

@pierwill
Copy link
Member Author

@rustbot author

@rustbot rustbot 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 Jan 25, 2022
@rust-log-analyzer

This comment has been minimized.

The data structure previously used here required Ord.
As part of rust-lang#90317, we do not want DefId to implement Ord.
@pierwill pierwill changed the title Return a hashmap in all_local_trait_impls query Return an indexmap in all_local_trait_impls query Jan 25, 2022
@pierwill
Copy link
Member Author

I tried this with FxHashMap and it caused ui test failures.

@pierwill
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 26, 2022
@bors
Copy link
Contributor

bors commented Jan 26, 2022

⌛ Trying commit f5fe6cd with merge fdfba66d9cef8e970a1c68a4b6fef10362925a7f...

@bors
Copy link
Contributor

bors commented Jan 26, 2022

☀️ Try build successful - checks-actions
Build commit: fdfba66d9cef8e970a1c68a4b6fef10362925a7f (fdfba66d9cef8e970a1c68a4b6fef10362925a7f)

@rust-timer
Copy link
Collaborator

Queued fdfba66d9cef8e970a1c68a4b6fef10362925a7f with parent 8cdb3cd, future comparison URL.

@pierwill
Copy link
Member 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 Jan 26, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fdfba66d9cef8e970a1c68a4b6fef10362925a7f): comparison url.

Summary: This benchmark run did not return any relevant results. 32 results were found to be statistically significant but too small to be relevant.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

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

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 26, 2022
@michaelwoerister
Copy link
Member

IndexMap is fine as long as it is constructed in a deterministic way. Do we know if that is the case here?

@pierwill
Copy link
Member Author

pierwill commented Jan 26, 2022

IndexMap is fine as long as it is constructed in a deterministic way. Do we know if that is the case here?

I'm not sure. Is this where the IndexMap would end up being constructed?

providers.all_local_trait_impls = |tcx, ()| &tcx.resolutions(()).trait_impls;

In that case, looks like the determinism would depend on rustc_middle::ty::context::TyCtxt::resolutions(). Where is that defined? I'm still learning how the query system works.

@cjgillot
Copy link
Contributor

resolutions is defined from tcx.untracked_resolutions, which is just data taken from the resolver and plugged as start conditions for the query system. Everything in resolutions is always checked by the query system (the query is both eval_always and no_hash), so it would not crash if it were non-deterministic. In this case, trait_impls is filled in rustc_resolve::late, which walks the AST in-order, so it is actually deterministic.

@cjgillot
Copy link
Contributor

@bors r+ rollup=iffy

@bors
Copy link
Contributor

bors commented Jan 28, 2022

📌 Commit f5fe6cd has been approved by cjgillot

@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 Jan 28, 2022
@bors
Copy link
Contributor

bors commented Feb 2, 2022

⌛ Testing commit f5fe6cd with merge 7cd14d2...

@bors
Copy link
Contributor

bors commented Feb 2, 2022

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 7cd14d2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 2, 2022
@bors bors merged commit 7cd14d2 into rust-lang:master Feb 2, 2022
@rustbot rustbot added this to the 1.60.0 milestone Feb 2, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7cd14d2): comparison url.

Summary: This benchmark run shows 4 relevant improvements 🎉 but 4 relevant regressions 😿 to instruction counts.

  • Average relevant regression: 0.6%
  • Average relevant improvement: -0.9%
  • Largest improvement in instruction counts: -1.1% on incr-unchanged builds of ctfe-stress-4 check
  • Largest regression in instruction counts: 0.8% on incr-unchanged builds of cranelift-codegen check

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

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.

None yet

8 participants