Skip to content

[rust2cpg] lower a..b expressions.#6087

Merged
xavierpinho merged 1 commit into
masterfrom
xavierp/range-expr
Jul 8, 2026
Merged

[rust2cpg] lower a..b expressions.#6087
xavierpinho merged 1 commit into
masterfrom
xavierp/range-expr

Conversation

@xavierpinho

Copy link
Copy Markdown
Contributor

Ranges a..b are syntax sugar for a core::ops::range::Range<_> struct literal with start + end fields. Since it's the same lowering we do for struct literals, also factored out that lowering (allocBlockAst) so it's used in both scenarios.

There are a few more kinds of ranges, some of which interestingly enough don't desugar into a struct literal but into a call. Tackling them in a follow up PR.

@xavierpinho xavierpinho merged commit 6179f90 into master Jul 8, 2026
8 checks passed
@xavierpinho xavierpinho deleted the xavierp/range-expr branch July 8, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants