Skip to content

refactor: Support associated constants in reorganize_definitions#1746

Merged
kkysen merged 2 commits into
immunant:masterfrom
Rua:assoc-const-refactorer
Apr 24, 2026
Merged

refactor: Support associated constants in reorganize_definitions#1746
kkysen merged 2 commits into
immunant:masterfrom
Rua:assoc-const-refactorer

Conversation

@Rua
Copy link
Copy Markdown
Contributor

@Rua Rua commented Apr 20, 2026

This was quite tricky to implement, but it's now working and #1659 passes its tests with these additions. Only const associated items are supported. type items could be added later, but fn is probably never going to work because they are too complex to test for equivalence.

Comment thread c2rust-refactor/src/transform/reorganize_definitions.rs
Comment thread c2rust-refactor/src/transform/reorganize_definitions.rs Outdated
Comment thread c2rust-refactor/src/transform/reorganize_definitions.rs
Comment thread c2rust-refactor/src/transform/reorganize_definitions.rs Outdated
Comment thread c2rust-refactor/src/transform/reorganize_definitions.rs Outdated
@ahomescu
Copy link
Copy Markdown
Contributor

Thanks for figuring this out, the fix looks good generally (modulo a couple of minor comments).

@Rua Rua force-pushed the assoc-const-refactorer branch from 49fe72a to b240976 Compare April 21, 2026 10:22
Comment thread c2rust-refactor/src/transform/reorganize_definitions.rs Outdated
@Rua Rua force-pushed the assoc-const-refactorer branch from b240976 to 0839f7a Compare April 22, 2026 09:33
Comment thread c2rust-refactor/tests/snapshots/reorganize_definitions.rs
@Rua Rua force-pushed the assoc-const-refactorer branch 6 times, most recently from 90c1410 to d272ee6 Compare April 24, 2026 12:11
@Rua Rua force-pushed the assoc-const-refactorer branch 2 times, most recently from f877b5f to ccaba68 Compare April 24, 2026 12:44
@Rua Rua force-pushed the assoc-const-refactorer branch from ccaba68 to a7c55c3 Compare April 24, 2026 13:05
@kkysen kkysen merged commit b0a6e51 into immunant:master Apr 24, 2026
10 checks passed
@Rua Rua deleted the assoc-const-refactorer branch April 24, 2026 20:17
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.

Refactorer breaks imports

3 participants