Skip to content

remove reliance on a trait solver inference bug #18840

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Apr 14, 2025

The parameter In of call_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 to In::Param<'_> is In::Param<'_> itself. It could just as well be some other associated type which only normalizes to In::Param<'_>. This will change with the next-generation trait solver and was encountered by a crater run rust-lang/rust#133502

cc 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 😅

the parameter `In` of `call_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 to `In::Param<'_>` is
`In::Param<'_>` itself. It could just as well be some other
associated type which only normalizes to `In::Param<'_>`.

cc rust-lang/trait-system-refactor-initiative#168
Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Apr 14, 2025
Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugly, but this does make sense, and this is fully internal so who cares :)
Thanks for keeping us future-aligned!

@cart cart added this pull request to the merge queue Apr 14, 2025
Merged via the queue into bevyengine:main with commit d7ec6a9 Apr 14, 2025
33 checks passed
mockersf pushed a commit that referenced this pull request Apr 14, 2025
The parameter `In` of `call_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 to `In::Param<'_>` is `In::Param<'_>`
itself. It could just as well be some other associated type which only
normalizes to `In::Param<'_>`. This will change with the next-generation
trait solver and was encountered by a crater run
rust-lang/rust#133502

cc
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 😅
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants