Skip to content

Commit

Permalink
Docs about proc_macros
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog committed Sep 30, 2024
1 parent 6a11ad9 commit 1a7c70d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions book/src/macros.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 1a7c70d

Please sign in to comment.