Skip to content

Document how to write tests requiring the 2018 edition #4367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down