Skip to content

transpile: Deep comparison of types in make_cast - #1984

Merged
ahomescu merged 2 commits into
immunant:masterfrom
Rua:types_eq
Sep 1, 2026
Merged

ahomescu merged 2 commits into
immunant:masterfrom
Rua:types_eq

Conversation

@Rua

@Rua Rua commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

This allows for detecting cases where two types should be considered equal at a deeper level. For example, *const usize vs *const size_t or [usize; N] vs [size_t; N].

@ahomescu ahomescu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use tests for deep comparisons of both arrays and function pointers.

Comment thread c2rust-transpile/src/c_ast/mod.rs Outdated
Comment thread c2rust-transpile/src/c_ast/mod.rs Outdated
@Rua
Rua force-pushed the types_eq branch 2 times, most recently from 9a6c60f to f032a4e Compare August 26, 2026 09:00
@Rua

Rua commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

I've added tests now for casts for pointers to arrays, and for pointers to functions where either a parameter or the return is a typedef.

@ahomescu ahomescu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, needs a rebase.

@ahomescu
ahomescu merged commit c0f3fbc into immunant:master Sep 1, 2026
11 checks passed
@Rua
Rua deleted the types_eq branch September 2, 2026 07:45
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