Skip to content

Commit 207e0db

Browse files
committed
Auto merge of #147282 - Zalathar:rollup-7wz3k9r, r=Zalathar
Rollup of 6 pull requests Successful merges: - rust-lang/rust#141839 (make rust-analyzer use a dedicated build directory) - rust-lang/rust#146166 (Implement range support in `//@ edition`) - rust-lang/rust#147259 (cg_llvm: Use helper methods for all calls to `LLVMMDNodeInContext2`) - rust-lang/rust#147263 (Disable triagebot auto stable-regression compiler backport nominations pending redesign) - rust-lang/rust#147268 (add arm-maintainers to various targets) - rust-lang/rust#147270 (Move doc_cfg-specific code into `cfg.rs`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents cbc8250 + b9cf874 commit 207e0db

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/tests/directives.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,20 @@ Consider writing the test as a proper incremental test instead.
262262

263263
</div>
264264

265+
#### The edition directive
266+
267+
The `//@ edition` directive can take an exact edition, a bounded half-open range of editions or a left-bounded half-open range of editions, this affects which edition is used by `./x test` to run the test. For example:
268+
269+
- A test with the `//@ edition: 2018` directive will only run under the 2018 edition.
270+
- A test with the `//@ edition: 2015..2021` directive can be run under both the 2015 and 2018 editions. However, CI will only run the test with the lowest edition possible (2015 in this case).
271+
- A test with the `//@ edition: 2018..` directive will run under any edition greater or equal than 2018. However, CI will only run the test with the lowest edition possible (2018 in this case).
272+
273+
You can also force `./x test` to use a specific edition by passing the `-- --edition=` argument. However, tests with the `//@ edition` directive will clamp the value passed to the argument. For example, if we run `./x test -- --edition=2015`:
274+
275+
- A test with the `//@ edition: 2018` will run with the 2018 edition.
276+
- A test with the `//@ edition: 2015..2021` will be run with the 2015 edition.
277+
- A test with the `//@ edition: 2018..` will run with the 2018 edition.
278+
265279
### Rustdoc
266280

267281
| Directive | Explanation | Supported test suites | Possible values |

0 commit comments

Comments
 (0)