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

Resolve lifetimes independently for each item-like. #103530

Merged
merged 5 commits into from
Nov 12, 2022

Conversation

cjgillot
Copy link
Contributor

Now that the heavy-lifting is done on the AST and during lowering, we do not need to perform HIR lifetime resolution on a full item at once. Instead, we can treat each item-like independently, and look at generics_of the parent exceptionally for associated items.

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

r? @estebank

(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 Oct 25, 2022
@cjgillot
Copy link
Contributor 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 Oct 25, 2022
@bors
Copy link
Contributor

bors commented Oct 25, 2022

⌛ Trying commit 4ad85429855d6f207f26be17875001be114b224a with merge 0640c07a0d4002c0a8944b68e5c83774614e5dbf...

@bors
Copy link
Contributor

bors commented Oct 25, 2022

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

@rust-timer
Copy link
Collaborator

Queued 0640c07a0d4002c0a8944b68e5c83774614e5dbf with parent 85d089b, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0640c07a0d4002c0a8944b68e5c83774614e5dbf): comparison URL.

Overall result: ✅ improvements - 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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-1.3%, -0.2%] 8
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)
8.9% [0.9%, 20.3%] 25
Regressions ❌
(secondary)
3.9% [3.7%, 4.1%] 2
Improvements ✅
(primary)
-5.4% [-6.5%, -4.3%] 4
Improvements ✅
(secondary)
-4.9% [-4.9%, -4.9%] 1
All ❌✅ (primary) 6.9% [-6.5%, 20.3%] 29

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)
10.9% [1.4%, 41.8%] 91
Regressions ❌
(secondary)
6.7% [2.0%, 16.6%] 31
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 10.9% [1.4%, 41.8%] 91

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 Oct 25, 2022
@cjgillot cjgillot force-pushed the hir-lifetimes-direct branch from 4ad8542 to be610d0 Compare November 1, 2022 09:19
@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot force-pushed the hir-lifetimes-direct branch from be610d0 to ad00b24 Compare November 1, 2022 11:35
Comment on lines 105 to 112
error: implementation of `Bar` is not general enough
--> $DIR/nested-rpit-hrtb.rs:51:93
|
LL | fn one_hrtb_mention_fn_outlives_uses<'b>() -> impl for<'a> Bar<'a, Assoc = impl Sized + 'b> {}
| ^^ implementation of `Bar` is not general enough
|
= note: `()` must implement `Bar<'0>`, for any lifetime `'0`...
= note: ...but it actually implements `Bar<'1>`, for some specific lifetime `'1`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do something to point at the return type here? Maybe special case functions that have no tail expression nor return statement?

Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

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

The code changes overall look fine, but I had a bunch of questions.

@estebank estebank 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 10, 2022
@cjgillot cjgillot force-pushed the hir-lifetimes-direct branch from ad00b24 to 60892e8 Compare November 11, 2022 10:29
@cjgillot cjgillot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 11, 2022
@cjgillot cjgillot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 11, 2022
@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Nov 11, 2022

📌 Commit 6c95805 has been approved by estebank

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 Nov 11, 2022
@bors
Copy link
Contributor

bors commented Nov 12, 2022

⌛ Testing commit 6c95805 with merge 825f8ed...

@bors
Copy link
Contributor

bors commented Nov 12, 2022

☀️ Test successful - checks-actions
Approved by: estebank
Pushing 825f8ed to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 12, 2022
@bors bors merged commit 825f8ed into rust-lang:master Nov 12, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 12, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (825f8ed): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -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.9% [0.8%, 1.2%] 4
Regressions ❌
(secondary)
1.5% [1.3%, 1.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) 0.9% [0.8%, 1.2%] 4

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.

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

@cjgillot cjgillot deleted the hir-lifetimes-direct branch November 12, 2022 09:32
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…ebank

Resolve lifetimes independently for each item-like.

Now that the heavy-lifting is done on the AST and during lowering, we do not need to perform HIR lifetime resolution on a full item at once.  Instead, we can treat each item-like independently, and look at `generics_of` the parent exceptionally for associated items.
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.

7 participants