Skip to content

Commit d2e452e

Browse files
committed
Update CONTRIBUTING.md for rustfix tests
1 parent 7661542 commit d2e452e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ Therefore you should use `tests/ui/update-all-references.sh` (after running
149149
`cargo test`) and check whether the output looks as you expect with `git diff`. Commit all
150150
`*.stderr` files, too.
151151

152+
If the lint you are working on is making use of structured suggestions, the
153+
test file should include a `// run-rustfix` comment at the top. This will
154+
additionally run [rustfix](https://github.com/rust-lang-nursery/rustfix) for
155+
that test. Rustfix will apply the suggestions from the lint to the code of the
156+
test file and compare that to the contents of a `.fixed` file.
157+
158+
Use `tests/ui/update-all-references.sh` to automatically generate the
159+
`.fixed` file after running `cargo test`.
160+
152161
### Running rustfmt
153162

154163
[Rustfmt](https://github.com/rust-lang/rustfmt) is a tool for formatting Rust code according

0 commit comments

Comments
 (0)