Skip to content

transpile: Dedup keywords#1636

Merged
kkysen merged 1 commit intoimmunant:masterfrom
cydparser:dedup-keywords
Mar 19, 2026
Merged

transpile: Dedup keywords#1636
kkysen merged 1 commit intoimmunant:masterfrom
cydparser:dedup-keywords

Conversation

@cydparser
Copy link
Copy Markdown
Contributor

This change extracts keywords into c2rust-transpile::RUST_KEYWORDS and reduces the amount of renaming in a few places. If I have understood the code correctly, RESERVED_NAMES should have only been used when renaming types, but it was also being used when renaming field names and module names.

Copy link
Copy Markdown
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! It seems, though, that there are a bunch more subtle things missing, some of which you've covered and brought to our attention, but there's still some more, and I suggested some other organizational changes, too.

Comment thread c2rust-transpile/src/lib.rs Outdated
Comment thread c2rust-transpile/src/lib.rs Outdated
Comment thread c2rust-transpile/src/convert_type.rs Outdated
Comment thread c2rust-transpile/src/translator/mod.rs Outdated
Comment thread c2rust-transpile/src/convert_type.rs Outdated
Comment thread c2rust-transpile/src/convert_type.rs
Comment thread c2rust-transpile/src/renamer.rs Outdated
Comment thread c2rust-transpile/tests/snapshots.rs
@cydparser cydparser force-pushed the dedup-keywords branch 3 times, most recently from 241ec73 to 9ff5180 Compare March 7, 2026 00:34
Comment thread c2rust-transpile/src/lib.rs Outdated
Comment thread c2rust-transpile/src/renamer.rs Outdated
Comment thread c2rust-transpile/src/renamer.rs
Comment thread c2rust-transpile/src/renamer.rs Outdated
Copy link
Copy Markdown
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

This generally LGTM besides a few comments. Thanks! Also, can you remove the .expect_compile_error_edition_2024(true) line in c2rust-transpile/tests/snapshots.rs after rebasing? This fixes that issue with gen.

@cydparser
Copy link
Copy Markdown
Contributor Author

@kkysen, thanks for the reviews. I think all requested changes have been made.

Comment thread c2rust-transpile/src/lib.rs Outdated
Comment thread c2rust-transpile/src/renamer.rs Outdated
Copy link
Copy Markdown
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

I fixed the couple of little remaining issues myself. Merging now.

@kkysen kkysen merged commit 2ea5c96 into immunant:master Mar 19, 2026
11 checks passed
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