Skip to content

Avoid value -> pointer -> value in rules - #550

Merged
nunoplopes merged 3 commits into
Cpp2Rust:masterfrom
lucic71:ref-expr
Oct 20, 2026
Merged

nunoplopes merged 3 commits into
Cpp2Rust:masterfrom
lucic71:ref-expr

Conversation

@lucic71

@lucic71 lucic71 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

References are translated as raw ptr / Ptr in the rules. This means that each value must be first converted to a pointer to apply the rule.

This generates unnecessary value -> pointer -> value roundtrips when the resulting reference is used in a value context.

This PR avoids this roundtrip.

@lucic71
lucic71 marked this pull request as draft October 20, 2026 12:23
@lucic71
lucic71 marked this pull request as ready for review October 20, 2026 12:24
@nunoplopes
nunoplopes merged commit 5a43d06 into Cpp2Rust:master Oct 20, 2026
9 checks passed
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