-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Stop errorring for elided lifetimes in path. #96957
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
Conversation
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #96833) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -1,3 +1,4 @@ | |||
// check-pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's surprising that this change is only picked up in this test. I would have expected it to be picked up in a parsing or lowering test or something.
Regardless, this change will need a lang (probably) FCP. FWIW, I personally don't think allowing elided lifetimes in impl
headers is the right move. It's 1) inconsistent with the general trend of not allow elided lifetime parameters and 2) unspecified on if it would be 'static
(as is assumed today under error conditions or some new lifetime (which would be the case if you did '_
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also maybe a bit confused here. I guess the ELIDED_LIFETIMES_IN_PATHS
lint is allow by default, but was erroring. Is that what you're cleaning up?
The goal of this PR is to simplify the implementation by having only one flavour of error. If relaxing the behaviour is not desirable, I will attempt to refactor the code to only have one implementation and one message. |
I think that is the case, yeah. We could poll the lang team, but given that the general trend seems to be more explicitness when there could be ambiguity (this error, It definitely does seem like there's some opportunity to clean this up though, even if we error or (maybe) lint depending on the context. |
This special case is used to ban elided lifetimes in path in async fns and impl block headers.
It does the same thing as the elided-lifetimes-in-paths lint, excepts as a hard error.
Having both flavours does not really bring anything but complexity.
This PR proposes to remove the special case.
This will allow to always use the
CreateParameter
mode for anonymous lifetimes in a later PR.