Skip to content

Commit 03601bb

Browse files
authored
Merge pull request #304 from GuillaumeGomez/revisions-example
Add example for revisions
2 parents 9e64edd + 53bf33b commit 03601bb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ their command specifies, or the test will fail without even being run.
5858
* `//~` comments can be restricted to specific revisions by adding the revision name after the `~` in square brackets: `//~[XXX]`
5959
* `//@` comments can be restricted to specific revisions by adding the revision name after the `@` in square brackets: `//@[XXX]`
6060
* Note that you cannot add revisions to the `revisions` command.
61+
62+
For example:
63+
64+
```rust
65+
//@revisions: edition2021 edition2024
66+
//@[edition2021] edition:2021
67+
//@[edition2024] edition:2024
68+
//@[edition2024] check-pass
69+
70+
// Then in code:
71+
let x = 12; //~[edition2021] dead_code
72+
let x = 12;
73+
//~[edition2021]^ dead_code
74+
```
6175
* `//@compile-flags: XXX` appends `XXX` to the command line arguments passed to the rustc driver
6276
* you can specify this multiple times, and all the flags will accumulate
6377
* `//@rustc-env: XXX=YYY` sets the env var `XXX` to `YYY` for the rustc driver execution.

0 commit comments

Comments
 (0)