-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Normalize before computing ConstArgHasType goal in new solver #142806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This PR changes a file inside |
This comment has been minimized.
This comment has been minimized.
c6112e1
to
46ff4fa
Compare
This comment has been minimized.
This comment has been minimized.
46ff4fa
to
87c8aa1
Compare
@@ -191,6 +191,7 @@ where | |||
goal: Goal<I, (I::Const, I::Ty)>, | |||
) -> QueryResult<I> { | |||
let (ct, ty) = goal.predicate; | |||
let ct = self.structurally_normalize_const(goal.param_env, ct)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if you want boxy to review this, but it feels very much correct to require normalizing before matching on the const kind here :> it's what we do for all other matches on kind
as well.
so r=me here
seems reasonable to me to normalize here. makes a nice property hold. definitely dont want to add a |
@bors r=lcnr,BoxyUwU |
I guess more thought: I like to think of it kind of like if const items had |
This is a fix for #139905. See the description I left in the test.
I chose to fix this by normalizing the type before matching on its
.kind()
incompute_const_arg_has_type_goal
(since it feels somewhat consistent with how we normalize types before assembling their candidates, for example); however, there are several other solutions that come to mind for fixing this ICE:ConstKind::Error
a proper type, likeConstKind::Value
, so that consts don't go from failing to passingConstArgHasType
goals after normalization (i.e.UNEVALUATED
would normalize into aConstKind::Error(_, bool)
type rather than losing its type altogether).Thoughts? Happy to discuss this fix further.
r? @BoxyUwU