transpile: Override pointer difference expression type to PtrDiff#1843
Open
Rua wants to merge 4 commits into
Open
transpile: Override pointer difference expression type to PtrDiff#1843Rua wants to merge 4 commits into
PtrDiff#1843Rua wants to merge 4 commits into
Conversation
PtrdiffPtrDiff
6336ba3 to
e962d4c
Compare
ahomescu
requested changes
Jun 11, 2026
40761b9 to
19cbcc4
Compare
Contributor
Author
|
This now depends on #1850 so that the definition of |
3dc93a5 to
2cf3e05
Compare
b28b829 to
bcd749b
Compare
ahomescu
reviewed
Jun 18, 2026
| ) -> WithStmts<Box<Expr>> { | ||
| let mut expr_rs = mk().method_call_expr(lhs_rs, "offset_from", vec![rhs_rs]); | ||
|
|
||
| if let Some(sz) = self.compute_size_of_expr(pointee_type_id) { |
Contributor
There was a problem hiding this comment.
Is this needed? If lhs_rs is already of type *mut $pointee_type then offset_from returns the size in units of $pointee_type. There is byte_offset_from for the byte distance. Am I missing something here?
Contributor
Author
There was a problem hiding this comment.
I'm not sure. I left it unchanged because it was already in the original code.
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.
c_longrather thanptrdiff_t#1837