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.
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.
UnOp does not have is_checkable. Given these docs, that seems surprising?
Neg
behaves like the 'checkable' bin ops, doesn't it?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.
UnOp::Neg would be checkable. What do you find surprising about that in context of this documentation?
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.
The surprising part is that there is no such function on
UnOp
-- that indicates some asymmetry in how UnOp vs BinOp are handled.Should we also have this on UnOp, and then replace the existing direct matching on
Neg
that I assume is happening with an is_checkable call?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.
Negation has a dedicated assertion kind for it, so there is no need for UnOp::is_checkable (see
git grep -C20 is_checkable
).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.
What does this have to do with assertion kinds? I was thinking of MIR building.
Though with #108282, MIR building does not use this function any more anyway. Then it's only the codegen backends and yeah there it has to do with assertion kinds.