Skip to content

Commit 76a19d3

Browse files
committed
Update rustfix section to new ui-test crate
1 parent 32dc7c5 commit 76a19d3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

book/src/development/writing_tests.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,16 @@ and prepending the `TESTNAME` variable to `cargo uitest` works for Cargo lints t
191191

192192
## Rustfix Tests
193193

194-
If the lint you are working on is making use of structured suggestions, the test
195-
file should include a `// run-rustfix` comment at the top.
194+
If the lint you are working on is making use of structured suggestions,
195+
`rustfix` will apply the suggestions from the lint to the test file code and
196+
compare that to the contents of a `.fixed` file.
196197

197198
Structured suggestions tell a user how to fix or re-write certain code that has
198199
been linted with [`span_lint_and_sugg`].
199200

200-
The `// run-rustfix` comment will additionally run [rustfix] for our test.
201-
Rustfix will apply the suggestions from the lint to the test file code and
202-
compare that to the contents of a `.fixed` file.
201+
Should `span_lint_and_sugg` be used to generate a suggestion, but not all
202+
suggestions lead to valid code, you can use the `//@no-rustfix` comment on top
203+
of the test file, to not run `rustfix` on that file.
203204

204205
We'll talk about suggestions more in depth in a later chapter.
205206
<!-- FIXME: (blyxyas) Link to "Emitting lints" when that gets merged -->

0 commit comments

Comments
 (0)