Fix duplicate lifetime parameter - #160378
Open
bb1yd wants to merge 1 commit into
Open
Conversation
bb1yd
force-pushed
the
fix-duplicate-lifetime-parameter
branch
2 times, most recently
from
August 3, 2026 06:51
3cb20ed to
77719b9
Compare
This comment has been minimized.
This comment has been minimized.
bb1yd
force-pushed
the
fix-duplicate-lifetime-parameter
branch
4 times, most recently
from
August 3, 2026 09:32
4238b42 to
403c96e
Compare
bb1yd
force-pushed
the
fix-duplicate-lifetime-parameter
branch
from
August 3, 2026 09:41
403c96e to
36b8615
Compare
bb1yd
marked this pull request as ready for review
August 3, 2026 11:24
Collaborator
|
r? @mu001999 rustbot has assigned @mu001999. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #123713
The previous code suggest adding a higher-ranked lifetime
for<'a>for regular case and explicit lifetime'afor associated type. But it didn't check whether the lifetime'ais already occupied and it never suggest the user to use the existing lifetime.I think that it might be better if we put the diagnostics code for error
E0637together withE0106in the same functionadd_missing_lifetime_specifiers_label, since they share some same logic.The current code behaves differently when there are lifetimes in scope:
for<'a>(regular case) or'a(associated type)The help message of introducing HRTB changed to the same with
E0106.