delegation: do not always inherit ConstArgHasType predicates#158722
Open
aerooneqq wants to merge 1 commit into
Open
delegation: do not always inherit ConstArgHasType predicates#158722aerooneqq wants to merge 1 commit into
ConstArgHasType predicates#158722aerooneqq wants to merge 1 commit into
Conversation
…st from delegation parent
0310105 to
4d1093d
Compare
Contributor
|
r? types |
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 explanation can be found in comment in
inherit_predicates_for_delegation_item.So the problem is that we have two
ConstArgHasTypepredicates inparam_envwhich tell that a single const has different types. But the functionfind_const_ty_from_envpanics in this situation. This assert is here for a long time, and I do not have enough knowledge to say if it is correct or not, however I have thoughts that having contradictory predicates should not lead to panic, instead an error from trait solver or whatever engine that solves those predicates should be reported. Do not want to dive too deep into researching and possibly rewritingfind_const_ty_from_env, so fixed it on delegation level.Fixes #158675. Part of #118212.
r? @petrochenkov