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

Bump elided_lifetimes_in_associated_constant to deny #124211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

compiler-errors
Copy link
Member

It's been 5 versions since this was last bumped. Let's bump it up again.

@rustbot
Copy link
Collaborator

rustbot commented Apr 20, 2024

r? @cjgillot

rustbot has assigned @cjgillot.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Apr 20, 2024
@compiler-errors compiler-errors added the I-lang-nominated The issue / PR has been nominated for discussion during a lang team meeting. label Apr 20, 2024
@tmandry tmandry added T-lang Relevant to the language team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 8, 2024
@tmandry
Copy link
Member

tmandry commented May 8, 2024

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented May 8, 2024

Team member @tmandry 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 May 8, 2024
@tmandry
Copy link
Member

tmandry commented May 8, 2024

Actually, I don't believe we should have this lint at all and should just use 'static everywhere. I'm about ready to file a different issue and FCP to remove the lint, but we wanted to hear from @nikomatsakis if he has any rationale for landing the lint.

@rfcbot concern let's just use 'static

@compiler-errors
Copy link
Member Author

@scottmcm
Copy link
Member

scottmcm commented May 8, 2024

I'd be happy continuing with our previous direction here, so
@rfcbot reviewed

But I'm also sympathetic to tyler's idea that it might be reasonable to decide to add an elision rule for this. I don't like an elision rule for fn foo() -> &T, but given that even associated it's still a const, it might be fine to have elision force unspecified to 'static for it.

@compiler-errors
Copy link
Member Author

'static is a more meaningful value than what's currently happening (recall from the tracking issue #115010 that elided lifetimes in associated consts turn into new generic lifetimes, which is very certainly not correct), but i still think we should still first unstabilize this behavior before deciding on what actually to do here.

@tmandry
Copy link
Member

tmandry commented May 8, 2024

@compiler-errors Does going straight to 'static only allow strictly more code to compile than before?

I still think we should still first unstabilize this behavior before deciding on what actually to do here.

Generally sympathetic, and from the notes we decided to do this before. At the same time, it is churn that feels unnecessary if we are going to turn around and allow all of the code again. Speaking of which: Did we ever look at how much churn there is in crater?

While the decision of using 'static looks trivial to me, I see references in the tracking issue to it needing an RFC and being more subtle than I expect. Modulo the "level of churn" question, I'm comfortable letting this FCP + stabilization cycle be a forcing function for us to find a better way, rather than block an already-agreed path (undoing the stabilization) on somebody doing more work.

@rfcbot resolve let's just use 'static

@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels May 8, 2024
@rfcbot
Copy link

rfcbot commented May 8, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@tmandry
Copy link
Member

tmandry commented May 8, 2024

Looking at the references to #115010 at the bottom of the issue, this lint has created a lot of churn already. This makes me think we should leave this PR nominated and discuss again at the next lang team meeting: Do we see a feasible alternative to going down this route?

@nikomatsakis
Copy link
Contributor

@tmandry I feel like I'm missing context here. I'm not sure, for example, what the current behavior is, etc.

I'm sympathetic to defaulting to 'static for consistency with const elsewhere and the reasons that I (apparently) outlined before.

I can certainly imagine reasons to not want 'static, but they are unusual, e.g., const Foo<'a> = None.

@traviscross
Copy link
Contributor

traviscross commented May 15, 2024

@rustbot labels -I-lang-nominated

We discussed this in the triage meeting today. We were in agreement that 'static is in fact the right default when there are no lifetimes in scope lexically and syntactically. @tmandry is going to write that up as a separate issue on which we can propose FCP.

@rustbot rustbot removed the I-lang-nominated The issue / PR has been nominated for discussion during a lang team meeting. label May 15, 2024
@tmandry
Copy link
Member

tmandry commented May 16, 2024

@rfcbot concern wait for FCP to default to 'static

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels May 16, 2024
@tmandry
Copy link
Member

tmandry commented May 16, 2024

The FCP in question has been proposed here: #125190

@jieyouxu jieyouxu added the L-elided_lifetimes_in_associated_constant Lint: elided_lifetimes_in_associated_constant label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. L-elided_lifetimes_in_associated_constant Lint: elided_lifetimes_in_associated_constant proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

None yet

9 participants