keep the use<..> bound in the refining_impl_trait suggestion - #162575
Open
Albab-Hasan wants to merge 1 commit into
Open
keep the use<..> bound in the refining_impl_trait suggestion#162575Albab-Hasan wants to merge 1 commit into
use<..> bound in the refining_impl_trait suggestion#162575Albab-Hasan wants to merge 1 commit into
Conversation
the lint suggested a return type built only from the trait bounds, so the precise capturing list was dropped. applying the suggestion then captured every lifetime in scope and failed to compile with "return type captures more lifetimes than trait definition". the suggestion now carries the capture list over, written in terms of the impl generics. a use<..> bound is only added when the trait opaque leaves out one of the method late bound lifetimes, since everything else already has to be listed in the trait. fixes rust-lang#141047
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 suggestion formats the traits RPITIT and
Displaydoesnt printuse<..>soimpl use<Self> + Sendrenders asimpl std::marker::Send. applying it makes the impl capture the elided&selflifetime which doesnt compile. new helper re emits the capture list when the trait dropped a lifetime.one note. no existing baselines were re blessed so the new test is the only in tree coverage of an undercapturing RPITIT.
fixes #141047
r? @davidtwco