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

Report undeclared lifetimes during late resolution. #95779

Merged
merged 8 commits into from
Apr 17, 2022

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Apr 7, 2022

First step in #91557

We reuse the rib design of the current resolution framework. Specific LifetimeRib and LifetimeRibKind types are introduced. The most important variant is LifetimeRibKind::Generics, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or a for<...> binder. The LifetimeBinderKind specifies how this rib behaves with respect to in-band lifetimes.

r? @petrochenkov

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

Some changes occurred in src/tools/rustfmt.

cc @calebcartwright

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 7, 2022
@bors

This comment was marked as resolved.

compiler/rustc_resolve/src/late.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/late.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/late.rs Outdated Show resolved Hide resolved
}

#[tracing::instrument(level = "debug", skip(self))]
fn resolve_anonymous_lifetime(&mut self, lifetime: &Lifetime, elided: bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is confusing because it doesn't actually resolve anything, only reports errors, but I guess the missing part is just introduced in some future commit.

compiler/rustc_resolve/src/late.rs Outdated Show resolved Hide resolved
@petrochenkov petrochenkov 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 Apr 13, 2022
@cjgillot cjgillot 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 Apr 13, 2022
@petrochenkov
Copy link
Contributor

r=me after addressing #95779 (comment) and squashing review commits into main commits.

@petrochenkov petrochenkov 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 Apr 14, 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 Apr 14, 2022
@bors
Copy link
Contributor

bors commented Apr 14, 2022

⌛ Trying commit d136af68aa1dd6735d0201a12769cc89e489be04 with merge 084f7019b88c60ebb175e17abc7c6515be0a04b7...

@bors
Copy link
Contributor

bors commented Apr 14, 2022

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

@rust-timer
Copy link
Collaborator

Queued 084f7019b88c60ebb175e17abc7c6515be0a04b7 with parent e7575f9, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (084f7019b88c60ebb175e17abc7c6515be0a04b7): comparison url.

Summary:

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 75 40 0 1 75
mean2 0.5% 0.4% N/A -0.3% 0.5%
max 0.9% 0.9% N/A -0.3% 0.9%

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

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@rustbot rustbot added perf-regression Performance regression. 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 Apr 14, 2022
@petrochenkov
Copy link
Contributor

With this PR compiler does some double work when resolving lifetimes, and the performance should be recovered when other parts of #91557 land.
@bors r+

@bors
Copy link
Contributor

bors commented Apr 14, 2022

📌 Commit d136af68aa1dd6735d0201a12769cc89e489be04 has been approved by petrochenkov

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 14, 2022
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 17, 2022

📌 Commit e628df9 has been approved by petrochenkov

@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 Apr 17, 2022
@bors
Copy link
Contributor

bors commented Apr 17, 2022

⌛ Testing commit e628df9 with merge 1ec2c13...

@bors
Copy link
Contributor

bors commented Apr 17, 2022

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 1ec2c13 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 17, 2022
@bors bors merged commit 1ec2c13 into rust-lang:master Apr 17, 2022
@rustbot rustbot added this to the 1.62.0 milestone Apr 17, 2022
@cjgillot cjgillot deleted the ast-lifetimes-undeclared branch April 17, 2022 15:40
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1ec2c13): comparison url.

Summary:

  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 58 39 1 2 59
mean2 0.5% 0.5% -2.5% -1.0% 0.5%
max 0.8% 1.1% -2.5% -1.0% -2.5%

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

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@@ -95,7 +95,7 @@ pub enum LifetimeName {
/// User wrote nothing (e.g., the lifetime in `&u32`).
///
/// The bool indicates whether the user should have written something.
Copy link
Member

Choose a reason for hiding this comment

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

This comment is now out of date.

@pnkfelix
Copy link
Member

Visiting for weekly performance triage

  • These performance regressions were anticipated (via measurement) during review of the PR and effectively already triaged.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Apr 21, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 21, 2022
…petrochenkov

Report undeclared lifetimes during late resolution.

First step in rust-lang#91557

We reuse the rib design of the current resolution framework. Specific `LifetimeRib` and `LifetimeRibKind` types are introduced. The most important variant is `LifetimeRibKind::Generics`, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or a `for<...>` binder. The `LifetimeBinderKind` specifies how this rib behaves with respect to in-band lifetimes.

r? `@petrochenkov`
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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.

None yet

9 participants