Fixup return position impl trait overcapturing for the 2024 edition#528
Merged
smalis-msft merged 4 commits intomicrosoft:mainfrom Jan 14, 2025
Merged
Conversation
ff1000f to
7327636
Compare
daprilik
reviewed
Dec 26, 2024
Contributor
daprilik
left a comment
There was a problem hiding this comment.
Seems fine to me. The extra verbosity is unfortunate, but given the scope of our codebase, and the fact that it only came up a total of - *checks notes* - ~23 times implies to me that its prob not gonna be a major annoyance moving forwards.
Contributor
Author
|
Yeah, all my gripes here are language concerns, not codebase ones. |
7327636 to
1d1caae
Compare
daprilik
approved these changes
Jan 14, 2025
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.
The Rust 2024 edition will be changing how
impl Traitin return position functions. Namely it will be changing the rules from capturing no lifetimes, to capturing all lifetimes. The reasons for this are documented in RFC 3498 and the migration guide. A new 'precise capturing' syntax has been added to allow cases that don't need everything captured to scope down what they take. This PR updates all such cases to use the new syntax.Note that currently this new syntax requires all type parameters in scope to be listed. This currently results in overcapturing of type parameters. This will be relaxed in the future, and is tracked by RFC 3617.
This PR also marks the edition_2024_expr_fragment_specifier lint as no longer needing fixing, as I have completed an audit of all our macros that it flagged and none of them need changing.
Part of #288