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

use LocalDefId instead of HirId in trait resolution to simplify the obligation clause resolution #103902

Merged
merged 1 commit into from
Jan 25, 2023

Conversation

vincenzopalazzo
Copy link
Member

@vincenzopalazzo vincenzopalazzo commented Nov 2, 2022

This commit introduces a refactoring suggested by @lcnr to simplify the obligation clause resolution.

This is just the first PR that introduces a type of refactoring, but others PRs will follow this to introduce name changing to change from the variable name from body_id to something else.

Fixes #104827

Signed-off-by: Vincenzo Palazzo vincenzopalazzodev@gmail.com

@rustbot r? @lcnr

@rustbot
Copy link
Collaborator

rustbot commented Nov 2, 2022

r? @nagisa

(rustbot has picked a reviewer for you, use r? to override)

@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 Nov 2, 2022
@rustbot rustbot assigned lcnr and unassigned nagisa Nov 2, 2022
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

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.

didn't yet look through everything, will do the rest of this PR later

compiler/rustc_hir_analysis/src/check/compare_method.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/check/compare_method.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/check/compare_method.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs Outdated Show resolved Hide resolved
@rust-log-analyzer

This comment has been minimized.

compiler/rustc_hir_analysis/src/check/intrinsic.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/hir_wf_check.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_typeck/src/check.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/hir/map/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_traits/src/implied_outlives_bounds.rs Outdated Show resolved Hide resolved
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

compiler/rustc_hir_analysis/src/check/compare_method.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/check/compare_method.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/check/compare_method.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/check/compare_method.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/check/compare_method.rs Outdated Show resolved Hide resolved
compiler/rustc_trait_selection/src/traits/wf.rs Outdated Show resolved Hide resolved
compiler/rustc_trait_selection/src/traits/wf.rs Outdated Show resolved Hide resolved
compiler/rustc_traits/src/type_op.rs Outdated Show resolved Hide resolved
compiler/rustc_traits/src/type_op.rs Outdated Show resolved Hide resolved
compiler/rustc_ty_utils/src/ty.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Nov 4, 2022

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

@oli-obk
Copy link
Contributor

oli-obk commented Nov 8, 2022

@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 Nov 8, 2022
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Nov 8, 2022
@vincenzopalazzo
Copy link
Member Author

@rustbot r? @cjgillot

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot assigned cjgillot and unassigned lcnr Nov 8, 2022
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 24, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Jan 24, 2023

@bors retry timeout

@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 24, 2023
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Jan 25, 2023

⌛ Testing commit 7d2c110 with merge b98e2203189b297d9f2800668e7b84e62d79b7b0...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Jan 25, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 25, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Jan 25, 2023

@bors retry unable to access 'https://github.com/rust-lang/stdarch.git/': Failed to connect to github.com port 443: Connection timed out

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

bors commented Jan 25, 2023

⌛ Testing commit 7d2c110 with merge 027c850...

@bors
Copy link
Contributor

bors commented Jan 25, 2023

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

1 similar comment
@bors
Copy link
Contributor

bors commented Jan 25, 2023

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

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (027c850): 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.3% [-0.3%, -0.2%] 4
Improvements ✅
(secondary)
-0.4% [-0.5%, -0.3%] 3
All ❌✅ (primary) -0.3% [-0.3%, -0.2%] 4

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)
3.5% [3.5%, 3.5%] 1
Regressions ❌
(secondary)
2.4% [2.2%, 2.9%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-3.0%, -1.0%] 2
All ❌✅ (primary) 3.5% [3.5%, 3.5%] 1

Cycles

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

@vincenzopalazzo vincenzopalazzo deleted the macros/obligation_rulesv2 branch January 25, 2023 21:49
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2023
Remove HirId -> LocalDefId map from HIR.

Having this map in HIR prevents the creating of new definitions after HIR has been built.
Thankfully, we do not need it.

Based on rust-lang#103902
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Feb 10, 2023
Remove HirId -> LocalDefId map from HIR.

Having this map in HIR prevents the creating of new definitions after HIR has been built.
Thankfully, we do not need it.

Based on rust-lang/rust#103902
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.

internal compiler error: local_def_id: no entry for HirId