Replies: 1 comment 3 replies
-
Update I just just found this paragraph here.
That makes me feel like there is no intent to support this functionality (which is fine). I wonder if this section should mention that it is possible for the user to use I'd be happy to submit a PR to update those docs later, if desired. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I tried
cargo-mutants
for the first time on the source code for one of my projects in which most of the mutation candidates are generated from declarative macros (primarily trait impls for various integer types).When running
cargo mutants
in my unmodified source tree, I get this output:However, when I run
cargo expand
on my library and fix any resulting compiler errors in the expanded code (due to direct use of unstable features etc.), I am able to get the following result:Overall, this seems like a difficult problem to solve for a number of reasons:
At least in my case, I had all of my source code and test code in my
lib.rs
file, and simply replacing thelib.rs
file with the expanded version would remove the tests, since the tests are also generated by macros. Using the--tests
flag fromcargo-expand
could solve this, but that makes it a lot harder to get everything compiling again after the expansion.The number of edge-case modifications to the expanded source code in order to get it to compile are likely difficult to automate. Though, there may be better ways than the approach I took: I'm certainly not a
cargo-expand
expert.I had a look through the existing issues and discussions, and I didn't see many conversations when searching for "macro", so I'm curious if any thought has been given to this type of functionality.
Lastly, thanks for the great work on this crate. It's both easy to use and incredibly useful out of the box with default settings.
Beta Was this translation helpful? Give feedback.
All reactions