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

Separate definitions and HIR owners in the type system #102040

Merged
merged 1 commit into from
Sep 25, 2022

Conversation

TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented Sep 20, 2022

Fixes #83158

r? @cjgillot

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 20, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 20, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 20, 2022

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

@TaKO8Ki TaKO8Ki force-pushed the separate-definitions-and-hir-owners branch from c8f5d30 to c6f5ed6 Compare September 20, 2022 06:22
@TaKO8Ki TaKO8Ki changed the title Separate definitions and HIR owners Separate definitions and HIR owners in the type system Sep 20, 2022
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Sep 20, 2022

@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 Sep 20, 2022
@bors
Copy link
Contributor

bors commented Sep 20, 2022

⌛ Trying commit 9ef994ecf1e229cfe0bc915893e872779822e484 with merge fc0ede293f9529a80d346d21cf20f5f8cb8b6b8d...

@bors
Copy link
Contributor

bors commented Sep 20, 2022

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

@rust-timer
Copy link
Collaborator

Queued fc0ede293f9529a80d346d21cf20f5f8cb8b6b8d with parent acb8934, future comparison URL.

@rust-log-analyzer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fc0ede293f9529a80d346d21cf20f5f8cb8b6b8d): comparison URL.

Overall result: ❌ regressions - 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-review -S-waiting-on-perf -perf-regression

Instruction count

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

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.0% [2.7%, 7.2%] 2
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-5.4% [-5.4%, -5.4%] 1
All ❌✅ (primary) -3.0% [-3.0%, -3.0%] 1

Cycles

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.2% [4.2%, 4.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 20, 2022
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Sep 20, 2022

@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 Sep 20, 2022
@bors
Copy link
Contributor

bors commented Sep 20, 2022

⌛ Trying commit a61e3632316cb4a90370ca420cac7486efeeb414 with merge ec9258ea1ae0965d54d386a2c3c7e90f70fc8494...

@bors
Copy link
Contributor

bors commented Sep 20, 2022

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

@rust-timer
Copy link
Collaborator

Queued ec9258ea1ae0965d54d386a2c3c7e90f70fc8494 with parent 8fd6d03, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ec9258ea1ae0965d54d386a2c3c7e90f70fc8494): comparison URL.

Overall result: ❌ regressions - 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-review -S-waiting-on-perf -perf-regression

Instruction count

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

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

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.

mean1 range count2
Regressions ❌
(primary)
8.1% [3.2%, 12.9%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.7% [-3.2%, -2.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [-3.2%, 12.9%] 4

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 20, 2022
@@ -2206,14 +2206,14 @@ pub struct FnSig<'hir> {
// so it can fetched later.
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, HashStable_Generic)]
pub struct TraitItemId {
pub def_id: LocalDefId,
pub def_id: OwnerId,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think any OwnerId fields or variables should not be named def_id.

@@ -302,7 +302,9 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
if free_region.bound_region.is_named() {
// A named region that is actually named.
Some(RegionName { name, source: RegionNameSource::NamedFreeRegion(span) })
} else if let hir::IsAsync::Async = tcx.asyncness(self.mir_hir_id().owner) {
} else if let hir::IsAsync::Async =
tcx.asyncness(self.mir_hir_id().owner.def_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Pre-existing: why mir_hir_id().owner and not mir_def_id()?

@@ -1588,7 +1588,7 @@ rustc_queries! {
arena_cache
desc { "resolving lifetimes" }
}
query named_region_map(_: LocalDefId) ->
query named_region_map(_: hir::OwnerId) ->
Copy link
Contributor

Choose a reason for hiding this comment

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

This requires to add an impl DepNodeParams for OwnerId which copies the one for LocalDefId.

@lqd
Copy link
Member

lqd commented Sep 21, 2022

It would be cool to add some documentation here: in comments in the code and maybe the HIR chapter in the rustc dev guide. The body of #83158 can be used as a base for OwnerId at least. What do you think ?

fix a ui test

use `into`

fix clippy ui test

fix a run-make-fulldeps test

implement `IntoQueryParam<DefId>` for `OwnerId`

use `OwnerId` for more queries

change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
@TaKO8Ki TaKO8Ki force-pushed the separate-definitions-and-hir-owners branch from fcc8399 to 8fe9360 Compare September 24, 2022 14:22
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Sep 24, 2022

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented Sep 24, 2022

📌 Commit 8fe9360 has been approved by cjgillot

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 Sep 24, 2022
@bors
Copy link
Contributor

bors commented Sep 24, 2022

⌛ Testing commit 8fe9360 with merge c61dde4cc4662710d7acef61383403d04a0a5d31...

@bors
Copy link
Contributor

bors commented Sep 24, 2022

💔 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 Sep 24, 2022
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Sep 24, 2022

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented Sep 24, 2022

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: [beta] Bump stage0 #102179

@bors
Copy link
Contributor

bors commented Sep 24, 2022

📌 Commit 8fe9360 has been approved by cjgillot

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 Sep 24, 2022
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Sep 24, 2022

@bors retry

@bors
Copy link
Contributor

bors commented Sep 24, 2022

⌛ Testing commit 8fe9360 with merge d0ece44...

@bors
Copy link
Contributor

bors commented Sep 25, 2022

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 25, 2022
@bors bors merged commit d0ece44 into rust-lang:master Sep 25, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 25, 2022
@TaKO8Ki TaKO8Ki deleted the separate-definitions-and-hir-owners branch September 25, 2022 01:45
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d0ece44): comparison URL.

Overall result: ❌ regressions - 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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [3.2%, 3.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-3.3%, -2.2%] 2
All ❌✅ (primary) - - 0

Cycles

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.

mean1 range count2
Regressions ❌
(primary)
3.1% [2.5%, 3.6%] 2
Regressions ❌
(secondary)
2.6% [2.0%, 3.2%] 2
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [-2.7%, 3.6%] 3

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate definitions and HIR owners in the type system
9 participants