Skip to content

transpile: Refactor and improve address-of handling - #1982

Draft
Rua wants to merge 12 commits into
immunant:masterfrom
Rua:array-decay-refactor
Draft

transpile: Refactor and improve address-of handling#1982
Rua wants to merge 12 commits into
immunant:masterfrom
Rua:array-decay-refactor

Conversation

@Rua

@Rua Rua commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

This PR does a few things that more or less depend on each other:

  • Using ptr::from_ref, which is now available in the currently used nightly. It's still unstable there, but it's stable in Rust 2024 so it shouldn't be much of an issue to use it?
  • Changing how convert_address_of_common handles casting after the borrow operation. It now compares the pointee types and casts only if actually needed.
  • Some refactoring and cleanup, including removal of decay_ref. It was a bit of a deadweight anyway since address-of was changed to use raw borrows. Using from_ref makes it completely unnecessary.

@Rua
Rua force-pushed the array-decay-refactor branch 2 times, most recently from 0f13150 to 70bcccb Compare August 24, 2026 08:24
@Rua Rua changed the title transpile: Shortcut derefs and subscripts for array decays too transpile: Refactor address-of handling Aug 24, 2026
@Rua
Rua force-pushed the array-decay-refactor branch 5 times, most recently from 39bc23c to 938ab27 Compare August 25, 2026 14:38
@Rua Rua changed the title transpile: Refactor address-of handling transpile: Refactor and improve address-of handling Aug 25, 2026
@Rua
Rua force-pushed the array-decay-refactor branch 4 times, most recently from 8846fc0 to 509de7a Compare August 25, 2026 17:00
@Rua
Rua force-pushed the array-decay-refactor branch from 509de7a to 2f12e6b Compare August 26, 2026 09:59
@Rua
Rua force-pushed the array-decay-refactor branch from 2f12e6b to e850d52 Compare August 26, 2026 10:02
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.

1 participant