transpile: Factor out more pointer-related functions#1521
transpile: Factor out more pointer-related functions#1521Rua wants to merge 4 commits intoimmunant:masterfrom
Conversation
ff423e5 to
3a55413
Compare
kkysen
left a comment
There was a problem hiding this comment.
By the way, when you do refactoring PRs like this, can you try to split out the pure moves vs. the semantic changes more carefully/fine-grained? It makes it much harder to review when mostly moves are mixed with some other changes (although I'm not sure if there are better ways of viewing the diffs; I tried --color-moved but it doesn't really work usually).
How is this now? |
|
Does anything else need to be done here? |
| e: Box<Expr>, | ||
| negated: bool, | ||
| mut val: Box<Expr>, | ||
| is_true: bool, |
There was a problem hiding this comment.
I think the previous way was clearer. Not sure if this commit helps.
There was a problem hiding this comment.
The use of negated felt unclear to me in the context of checking "is null". Is it checking if "is null" is negated, or if its truthiness in the C sense is negated? With the new wording it's hopefully more clear that it's checking if "is null" is true or false.
There was a problem hiding this comment.
I've now renamed it to is_null to hopefully make it even more obvious.
6363a6e to
5e409dd
Compare
This factors out functions for two things: casts involving pointers, and null checking. In the case of
==and!=operators in a non-conditional context (in operators.rs), this also adds special handling for regular pointers, where only function pointers were specially handled previously. This means thatis now translated with the
is_nullmethod as well, instead of with the==operator andcore::ptr::null.