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

Identify anonymous lifetimes by their DefId in HIR. #94773

Merged
merged 2 commits into from
Mar 14, 2022

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Mar 9, 2022

ParamName::Fresh currently identifies anonymous lifetimes by an usize index computed from the number of lifetimes in scope. This makes the behaviour of lowering dependent on the contents of the surrounding item in unpredictable ways.

This PR replaces this index by the LocalDefId of the synthetized generic lifetime parameter. This makes obvious which parameter the lifetime corresponds to.

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

r? @oli-obk

(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 Mar 9, 2022
@@ -136,13 +136,13 @@ struct LoweringContext<'a, 'hir: 'a> {
/// (i.e., it doesn't appear in the in_scope_lifetimes list), it is added
/// to this list. The results of this list are then added to the list of
/// lifetime definitions in the corresponding impl or function generics.
lifetimes_to_define: Vec<(Span, ParamName)>,
lifetimes_to_define: Vec<(Span, NodeId)>,

/// `true` if in-band lifetimes are being collected. This is used to
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the docs to reflect what the field's value now means

compiler/rustc_ast_lowering/src/item.rs Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented Mar 10, 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 Mar 10, 2022
@bors
Copy link
Contributor

bors commented Mar 10, 2022

⌛ Trying commit 06122c00d51910c4b15cb514245b11def5038406 with merge 1a6c9b6b9600eb7e14a1cce6d8c23d8f916c322f...

@oli-obk oli-obk 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 Mar 10, 2022
@bors
Copy link
Contributor

bors commented Mar 10, 2022

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

@rust-timer
Copy link
Collaborator

Queued 1a6c9b6b9600eb7e14a1cce6d8c23d8f916c322f with parent ba14a83, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1a6c9b6b9600eb7e14a1cce6d8c23d8f916c322f): comparison url.

Summary: This benchmark run did not return any relevant results. 5 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 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 10, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Mar 10, 2022

r=me with docs updated

@cjgillot cjgillot force-pushed the lifetime-fresh-did branch from 06122c0 to c8c691f Compare March 13, 2022 22:14
@cjgillot
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Mar 13, 2022

📌 Commit c8c691f has been approved by oli-obk

@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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 13, 2022
@bors
Copy link
Contributor

bors commented Mar 14, 2022

⌛ Testing commit c8c691f with merge 3f58828...

@bors
Copy link
Contributor

bors commented Mar 14, 2022

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 14, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3f58828): comparison url.

Summary: This benchmark run did not return any relevant results.

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

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