remove reliance on a trait solver inference bug #18840
Merged
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 parameter
In
ofcall_inner
is completely unconstrained by its arguments and return type. We are only able to infer it by assuming that the only associated type equal toIn::Param<'_>
isIn::Param<'_>
itself. It could just as well be some other associated type which only normalizes toIn::Param<'_>
. This will change with the next-generation trait solver and was encountered by a crater run rust-lang/rust#133502cc rust-lang/trait-system-refactor-initiative#168
I couldn't think of a cleaner alternative here. I first tried to just provide
In
as an explicit type parameter. This is also kinda ugly as I need to provide a variable number of them and${ignore(..)}
is currently still unstable rust-lang/rust#83527.Sorry for the inconvenience. Also fun that this function exists to avoid a separate solver bug in the first place 😅