about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-08-12 04:38:50 +0000
committerbors <bors@rust-lang.org>2019-08-12 04:38:50 +0000
commited1de3d3775630b233790e41f0c7064a7d4ec495 (patch)
treec3a53cbb5a8126186acd8ecec0171964f3ad56f7
parent7a0ac4c25db51931a9e44850461817ae00530b46 (diff)
parent99d1cde8d8846b118610b67d23d22591c2798a2b (diff)
downloadrust-ed1de3d3775630b233790e41f0c7064a7d4ec495.tar.gz
rust-ed1de3d3775630b233790e41f0c7064a7d4ec495.zip
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
-rw-r--r--doc/adding_lints.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/adding_lints.md b/doc/adding_lints.md
index ef09c423044..d87580191fb 100644
--- a/doc/adding_lints.md
+++ b/doc/adding_lints.md
@@ -10,6 +10,7 @@ because that's clearly a non-descriptive name.
 * [Setup](#Setup)
 * [Testing](#Testing)
 * [Rustfix tests](#Rustfix-tests)
+* [Edition 2018 tests](#Edition-2018-tests)
 * [Lint declaration](#Lint-declaration)
 * [Lint passes](#Lint-passes)
 * [Emitting a lint](#Emitting-a-lint)
@@ -101,6 +102,12 @@ Use `tests/ui/update-all-references.sh` to automatically generate the
 
 With tests in place, let's have a look at implementing our lint now.
 
+### Edition 2018 tests
+
+Some features require the 2018 edition to work (e.g. `async_await`), but
+compile-test tests run on the 2015 edition by default. To change this behavior
+add `// compile-flags: --edition 2018` at the top of the test file.
+
 ### Testing manually
 
 Manually testing against an example file can be useful if you have added some