Skip to content

Conversation

@Rua
Copy link
Contributor

@Rua Rua commented Nov 4, 2025

Depends on #1478.

This combines handling of the address-of and array-decay cast into a common function.

In the current code, this check for whether the created pointer type has a different pointee than the actual desired pointee type is only applied to array-to-pointer decays but not address-of. I left it that way, but perhaps it's also good to have it for address-of?

// If the target pointee type is different from the source element type,
// then we need to cast the ptr type as well.
if arg_cty_kind.element_ty().map_or(false, |arg_element_cty| {
arg_element_cty != pointee_cty.ctype
}) {
needs_cast = true;
}

@Rua Rua force-pushed the addr-of-refactor branch 12 times, most recently from 07d7881 to bbeb6de Compare November 6, 2025 09:39
@Rua Rua force-pushed the addr-of-refactor branch from bbeb6de to 07779b3 Compare November 26, 2025 16:27
@Rua Rua force-pushed the addr-of-refactor branch from 07779b3 to 5a55ba9 Compare November 26, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant