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

Make late_bound_lifetime_arguments a hard error. #108782

Closed
wants to merge 3 commits into from

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Mar 5, 2023

Split from #103448

That lint has been there for 5 years.

Fixes #42868

@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2023

r? @oli-obk

(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 Mar 5, 2023
@compiler-errors
Copy link
Member

Should we crater this? It would be nice to see what crates could use fix PRs to reduce the fallout of this.

@cjgillot
Copy link
Contributor Author

cjgillot commented Mar 5, 2023

@bors try

@bors
Copy link
Contributor

bors commented Mar 5, 2023

⌛ Trying commit 270fa94 with merge ab173a644b8654eb56e6d7c92e29be4886d65169...

@bors
Copy link
Contributor

bors commented Mar 5, 2023

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

@compiler-errors
Copy link
Member

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-108782 created and queued.
🤖 Automatically detected try build ab173a644b8654eb56e6d7c92e29be4886d65169
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 5, 2023
@craterbot
Copy link
Collaborator

🚧 Experiment pr-108782 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-108782 is completed!
📊 56 regressed and 1 fixed (257564 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Mar 7, 2023
@cjgillot
Copy link
Contributor Author

cjgillot commented Mar 7, 2023

@craterbot
Copy link
Collaborator

👌 Experiment pr-108782-1 created and queued.
🤖 Automatically detected try build ab173a644b8654eb56e6d7c92e29be4886d65169
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 7, 2023
@craterbot
Copy link
Collaborator

🚧 Experiment pr-108782-1 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-108782-1 is completed!
📊 56 regressed and 0 fixed (56 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Mar 7, 2023
@cjgillot
Copy link
Contributor Author

Crater report:

  • use of cssparser 0.17 and 0.25, those versions date back to 2017 and 2019. Latest release 0.27 does not error.
  • use of roaring 0.4.2, from 2019. Latest release 0.10 does not error.
  • use of scoped pool 1.0, from 2017. There is one PR to fix the warning since 2017, unmerged.
  • zerocopy 0.7.0-alpha.3 which errs because it denies the lint, so ok.
  • container-broadcast, no github repo, fixed by applying the suggestion.
  • easy-csv, 7 year old, fixed by applying the suggestion.
  • Sladuca.berkletree, repository archived.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 14, 2023

Does roaring 0.5 also not error? The two crates that depend on 0.4 have no README and no updates since 5 years.

The only cssparser dependencies for versions at 0.25 or earlier are either explicitly abandoned or have no README and no updates since 5 years.

@oli-obk oli-obk added T-lang Relevant to the language team, which will review and decide on the PR/issue. I-lang-nominated Nominated for discussion during a lang team meeting. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 14, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Mar 14, 2023

Nominating for lang team FCP. The summary in the tracking issue #42868 is still up to date, so I'm not creating a new summary.

The only regressions are in abandoned crates or outdated (and unused) versions of crates that have been updated to not trigger the future incompat lint.

@nikomatsakis
Copy link
Contributor

@rfcbot fcp merge

Discussed in a (minimally attended) lang-team triage meeting and we are in favor of moving forward with this.

@rfcbot
Copy link

rfcbot commented Mar 14, 2023

Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged team members:

Concerns:

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Mar 14, 2023
@nikomatsakis
Copy link
Contributor

@rustbot labels -I-lang-nominated

@rustbot rustbot removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Mar 14, 2023
@BoxyUwU
Copy link
Member

BoxyUwU commented Mar 16, 2023

The intention long term is to make all lifetimes late bound, I would have thought this would mean we should be removing this lint not making it a hard error since otherwise you would be unable to ever turbofish lifetime args. not to mention we may end up with late bound type and const parameters, not being able to turbofish any generic arguments seems not great.

@BoxyUwU
Copy link
Member

BoxyUwU commented Mar 16, 2023

It would probably be a good idea to nominate this for t-types discussion to figure out how this lint interacts with long term plans for late bound generic parameters

@BoxyUwU BoxyUwU added the I-types-nominated Nominated for discussion during a types team meeting. label Mar 16, 2023
@tmandry
Copy link
Member

tmandry commented Mar 21, 2023

@rfcbot concern types-team-input

Agreed that types team should weigh in here.

@tmandry
Copy link
Member

tmandry commented Apr 18, 2023

@rust-lang/types, can you comment on this proposal with respect to the following?

It would probably be a good idea to nominate this for t-types discussion to figure out how this lint interacts with long term plans for late bound generic parameters

@jackh726
Copy link
Member

We haven't discussed this yet, but I do think we should weigh in here. Likely we'll go through nominated issues as a team at the beginning of next month.

@RalfJung
Copy link
Member

RalfJung commented Apr 21, 2023

I don't understand why we even want to disallow explicitly stating late-bound lifetime parameters. This is the first time I hear of #42868, and that issue description is confusing to me and doesn't sufficiently motivate the change being made.

I posted my confusion/question at #42868 (comment), though now I realize maybe I should have done that here? let me quote it for your convenience:

I have to say I am quite confused by the issue description here, and I don't understand what the underlying issue is. The core of my confusion seems to be captured by this (repeated) statement

the first argument doesn't make much sense because the function is not parameterized by 'a.

I strongly disagree! The function is parameterized by 'a. Sure, this parameter is a type system fiction (the actual runtime address of the function is the same for all choices of 'a), but that doesn't make 'a any less of a parameter. It can still be valuable to explicitly set that parameter to guide inference.

Taking a step back: The fact that some lifetime parameters are type system fictions while others are actually relevant for monomorphization is very confusing and surprising. (I have never fully understood why this is the case; I'll need to dig into this some time.) This will clearly incur some friction when creating function pointers since monomorphization-relevant ("early-bound") lifetime parameters need to be chosen the moment the function pointer is created. I can see that we might want to improve that situation. But reading just this issue I really don't understand the motivation for the current change, since there's a big gap between "unfortunately some lifetime parameters actually matter for monomorphization" and "other lifetime parameters (that don't matter for monomorphization) don't make sense and we should disallow people from explicitly stating them". Which problem is being solved here?

I guess it's time I use my lang team advisor hat for the first time. ;)
@rfcbot concern unclear-motivation

@tmandry
Copy link
Member

tmandry commented Apr 25, 2023

Since rfcbot hasn't fully implemented the advisors role yet, I'll proxy Ralf's concern.

@rfcbot concern unclear-motivation

@cjgillot
Copy link
Contributor Author

There is no real motivation on my end besides simplifying the implementation of #103448. Closing for now, until I get back to that PR.

@cjgillot cjgillot closed this May 11, 2023
@rfcbot rfcbot removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-types-nominated Nominated for discussion during a types team meeting. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for future-incompatibility lint late_bound_lifetime_arguments