Skip to content

Commit ed1de3d

Browse files
committed
Auto merge of #4367 - flip1995:doc_edition_2018_tests, r=phansch
Document how to write tests requiring the 2018 edition [Rendered](https://github.com/flip1995/rust-clippy/blob/doc_edition_2018_tests/doc/adding_lints.md#Edition-2018-tests) cc #4365 changelog: none
2 parents 7a0ac4c + 99d1cde commit ed1de3d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/adding_lints.md

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ because that's clearly a non-descriptive name.
1010
* [Setup](#Setup)
1111
* [Testing](#Testing)
1212
* [Rustfix tests](#Rustfix-tests)
13+
* [Edition 2018 tests](#Edition-2018-tests)
1314
* [Lint declaration](#Lint-declaration)
1415
* [Lint passes](#Lint-passes)
1516
* [Emitting a lint](#Emitting-a-lint)
@@ -101,6 +102,12 @@ Use `tests/ui/update-all-references.sh` to automatically generate the
101102

102103
With tests in place, let's have a look at implementing our lint now.
103104

105+
### Edition 2018 tests
106+
107+
Some features require the 2018 edition to work (e.g. `async_await`), but
108+
compile-test tests run on the 2015 edition by default. To change this behavior
109+
add `// compile-flags: --edition 2018` at the top of the test file.
110+
104111
### Testing manually
105112

106113
Manually testing against an example file can be useful if you have added some

0 commit comments

Comments
 (0)