refactor: tests: compile and format old and new .rs snapshot tests#1609
Merged
refactor: tests: compile and format old and new .rs snapshot tests#1609
.rs snapshot tests#1609Conversation
ahomescu
reviewed
Feb 24, 2026
…asily add more options
This refactors `test_refactor` into a `fn refactor`/`struct RefactorTest` builder.
…st-refactor`'s snapshot tests This means that if we say we expect an error but it doesn't, then panic.
…missing `unsafe` block around `std::mem::uninitialized()`
…#[inline(never)] fn foo`
…stc` on the new `.rs`
…/ `#[repr(uN)]`s `#[repr(uN)]` isn't allowed on `struct`s, so this is just a compile error.
…`reorder_derives.rs` un-formatted
…l(c2rust)]` and enable compiling `rename_unnamed.rs` `rename_unnamed.rs` had compile errors due to the `#[header_src = "..."]`s and `#![register_tool(c2rust)]`, but these aren't actually needed for `rename_unnamed`, just for `reorganize_definitions`. So we can remove that and enable checking `rename_unnamed.rs` (old and new) with `rustc`.
a8dc496 to
eb35127
Compare
ahomescu
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This also checks that the before (old) and after (new)
.rsfiles for the refactor snapshot tests are well-formatted and compile, with options to disable each of them.Some of these tests have compile errors, so we have the option to disable them. For example,
rename_unnamed.rshas src loc annotations that arerustcerrors.test_reflect.rsproduces type annotations that aren't correct syntax, so that doesn't compile. And for formatting, sometimes what we want to test, likereorder_derives.rs, is obviated if we format it first.