diff --git a/NEWS.md b/NEWS.md index 2362d8ec..44f4c7e6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ ## Unreleased +- New: Mutate `proc_macro` targets and functions. + - Fixed: Avoid generating empty string elements in `ENCODED_RUSTFLAGS` when `--cap-lints` is set. In some situations these could cause a compiler error complaining about the empty argument. - New: `--profile` option allows selecting a Cargo profile. In particular, it's recommended that you can use `--profile=mutants` and configure a custom profile in your `Cargo.toml` to optimize the build for mutants, by turning off debug symbols. diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 2dd284f0..70adbab1 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -24,6 +24,7 @@ - [Strict lints](lints.md) - [Generating mutants](mutants.md) - [Error values](error-values.md) + - [Macros](macros.md) - [Improving performance](performance.md) - [Parallelism](parallelism.md) - [Jobserver](jobserver.md) diff --git a/book/src/macros.md b/book/src/macros.md new file mode 100644 index 00000000..48b328b5 --- /dev/null +++ b/book/src/macros.md @@ -0,0 +1,5 @@ +# Mutating code using macros + +cargo-mutants will mutate the contents of `#[proc_macro]` functions defined in the current crate, and run tests to see if those mutations are caught. + +cargo-mutants does not currently mutate calls to macros, or the expansion of a macro, or the definition of declarative `macro_rules` macros. As a result on code that is mostly produced by macro expansion it may not find many mutation opportunities.