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

Enable potential_query_instability lint in rustc_hir_typeck. #113328

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

michaelwoerister
Copy link
Member

Fix linting errors by using FxIndex(Map|Set) and Unord(Map|Set) as appropriate. Part of MCP 533.

I really like the potential_query_instability lint!

r? @lcnr

@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 4, 2023
@michaelwoerister
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented Jul 4, 2023

⌛ Trying commit 4a2a38bcb70c8623f3f71c3af1496a6dd794ca7b with merge 76199ee47fd0a53283a41c58c3eae48a6f3aa9c7...

@bors
Copy link
Contributor

bors commented Jul 4, 2023

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

@rust-timer

This comment has been minimized.

@@ -7,6 +7,7 @@
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/borrow_check.html

use crate::ty::TyCtxt;
use hir::HirIdMap;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
use hir::HirIdMap;
use rustc_hir::HirIdMap;

@@ -1,12 +1,12 @@
use crate::middle::region::{Scope, ScopeData, ScopeTree};
use rustc_data_structures::fx::FxHashMap;
use hir::ItemLocalMap;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
use hir::ItemLocalMap;
use rustc_hir::ItemLocalMap;

compiler/rustc_middle/src/ty/closure.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/ty/closure.rs Outdated Show resolved Hide resolved
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (76199ee47fd0a53283a41c58c3eae48a6f3aa9c7): comparison URL.

Overall result: no relevant changes - no action needed

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 may lead to changes in compiler perf.

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

Instruction count

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

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
2.0% [1.4%, 2.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.4% [-8.4%, -2.5%] 2
All ❌✅ (primary) 0.5% [0.5%, 0.5%] 1

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: 654.344s -> 654.024s (-0.05%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 4, 2023
@michaelwoerister
Copy link
Member Author

michaelwoerister commented Jul 6, 2023

I want to try and see if I can resolve @cjgillot's comments but it might be a few days before I get to it.

@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 Jul 6, 2023
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

r=me after nits and @cjgillot review

compiler/rustc_hir_typeck/src/upvar.rs Show resolved Hide resolved
compiler/rustc_hir_typeck/src/writeback.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor

lcnr commented Jul 6, 2023

r? @cjgillot

@rustbot rustbot assigned cjgillot and unassigned lcnr Jul 6, 2023
@michaelwoerister
Copy link
Member Author

Let's see if sorting during typeck writeback has a performance impact.
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented Jul 6, 2023

⌛ Trying commit d4f2f3bffe364fd4751dc077e3044cbe769d6d69 with merge 02ae3e8e05f123322f34b0a60bd9c88f0e712d32...

@bors
Copy link
Contributor

bors commented Jul 6, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (02ae3e8e05f123322f34b0a60bd9c88f0e712d32): comparison URL.

Overall result: no relevant changes - no action needed

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 may lead to changes in compiler perf.

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

Instruction count

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

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.2%] 1
All ❌✅ (primary) -0.7% [-2.3%, 0.8%] 2

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: 657.995s -> 656.043s (-0.30%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 7, 2023
@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 Jul 10, 2023
@bors
Copy link
Contributor

bors commented Jul 12, 2023

☔ The latest upstream changes (presumably #113573) made this pull request unmergeable. Please resolve the merge conflicts.

@lcnr
Copy link
Contributor

lcnr commented Jul 13, 2023

not sure whether @cjgillot still has any open reviews? if not, r=cjgillot,lcnr after rebase

@@ -908,19 +909,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
/// Combines all the reasons for 2229 migrations
fn compute_2229_migrations_reasons(
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 should we just remove this function 😓 we're now simply creating a struct

@cjgillot
Copy link
Contributor

@bors r=cjgillot,lcnr
except if you want to address #113328 (comment)

@bors
Copy link
Contributor

bors commented Jul 13, 2023

📌 Commit 03169c52372d7d9c0fde285bc5cd28fb134ef35d has been approved by cjgillot,lcnr

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 13, 2023
@michaelwoerister
Copy link
Member Author

Thanks for reviewing, @cjgillot & @lcnr!

except if you want to address #113328 (comment)

I think that's better done separately and by someone with more context.

@bors
Copy link
Contributor

bors commented Jul 13, 2023

☔ The latest upstream changes (presumably #113637) made this pull request unmergeable. Please resolve the merge conflicts.

@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 13, 2023
@bors
Copy link
Contributor

bors commented Jul 14, 2023

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout no_hashmap_in_typeck (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self no_hashmap_in_typeck --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging compiler/rustc_middle/src/ty/mod.rs
Auto-merging compiler/rustc_hir_typeck/src/upvar.rs
CONFLICT (content): Merge conflict in compiler/rustc_hir_typeck/src/upvar.rs
Auto-merging compiler/rustc_hir_typeck/src/method/suggest.rs
Auto-merging compiler/rustc_hir_analysis/src/check_unused.rs
Automatic merge failed; fix conflicts and then commit the result.

Fix linting errors by using FxIndex(Map|Set) and Unord(Map|Set) as appropriate.
@cjgillot
Copy link
Contributor

@bors r=cjgillot,lcnr

@bors
Copy link
Contributor

bors commented Jul 14, 2023

📌 Commit 457b787 has been approved by cjgillot,lcnr

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 14, 2023
@bors
Copy link
Contributor

bors commented Jul 14, 2023

⌛ Testing commit 457b787 with merge df5c2cf...

@bors
Copy link
Contributor

bors commented Jul 14, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot,lcnr
Pushing df5c2cf to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 14, 2023
@bors bors merged commit df5c2cf into rust-lang:master Jul 14, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 14, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (df5c2cf): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.5% [0.8%, 2.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
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: 657.803s -> 658.312s (0.08%)

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

6 participants