Skip to content

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

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

transpile: Refactor and improve address-of handling#1982
Rua wants to merge 11 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 converted 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 4 times, most recently from c934f5d to 39bc23c Compare August 24, 2026 16:13
@Rua
Rua force-pushed the array-decay-refactor branch 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 from 938ab27 to 49af56b Compare August 25, 2026 14:53
@Rua
Rua force-pushed the array-decay-refactor branch from 49af56b to c37c781 Compare August 25, 2026 15:20
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