@@ -8,24 +8,23 @@ They must appear before the Rust source in the test.
8
8
They may also appear in Makefiles for [ run-make tests] ( compiletest.md#run-make-tests ) .
9
9
10
10
They are normally put after the short comment that explains the point of this test.
11
- Some test suites use ` //@ ` to signal that a comment is a header, but most are still
12
- just using plain comments.
13
- For example, this test uses the ` // compile-flags ` command to specify a custom
11
+ Compiletest test suites use ` //@ ` to signal that a comment is a header.
12
+ For example, this test uses the ` //@ compile-flags ` command to specify a custom
14
13
flag to give to rustc when the test is compiled:
15
14
16
15
``` rust,ignore
17
16
// Test the behavior of `0 - 1` when overflow checks are disabled.
18
17
19
- // compile-flags: -C overflow-checks=off
18
+ //@ compile-flags: -C overflow-checks=off
20
19
21
20
fn main() {
22
21
let x = 0 - 1;
23
22
...
24
23
}
25
24
```
26
25
27
- Header commands can be standalone (like ` // run-pass ` ) or take a value (like
28
- ` // compile-flags: -C overflow-checks=off ` ).
26
+ Header commands can be standalone (like ` //@ run-pass ` ) or take a value (like
27
+ ` //@ compile-flags: -C overflow-checks=off ` ).
29
28
30
29
## Header commands
31
30
@@ -192,10 +191,10 @@ The following headers are generally available, and not specific to particular
192
191
test suites.
193
192
194
193
* ` compile-flags ` passes extra command-line args to the compiler,
195
- e.g. ` // compile-flags: -g ` which forces debuginfo to be enabled.
194
+ e.g. ` //@ compile-flags: -g ` which forces debuginfo to be enabled.
196
195
* ` run-flags ` passes extra args to the test if the test is to be executed.
197
196
* ` edition ` controls the edition the test should be compiled with
198
- (defaults to 2015). Example usage: ` // edition:2018 ` .
197
+ (defaults to 2015). Example usage: ` //@ edition:2018 ` .
199
198
* ` failure-status ` specifies the numeric exit code that should be expected for
200
199
tests that expect an error.
201
200
If this is not set, the default is 1.
@@ -239,7 +238,7 @@ For example, if you need to pass a compiler flag with a path to a specific
239
238
file, something like the following could work:
240
239
241
240
``` rust,ignore
242
- // compile-flags: --remap-path-prefix={{src-base}}=/the/src
241
+ //@ compile-flags: --remap-path-prefix={{src-base}}=/the/src
243
242
```
244
243
245
244
Where the sentinel ` {{src-base}} ` will be replaced with the appropriate path
@@ -285,8 +284,8 @@ also in [`src/tools/compiletest/src/header.rs`] (note that the `Config`
285
284
struct's declaration block is found in [ ` src/tools/compiletest/src/common.rs ` ] ).
286
285
` TestProps ` 's ` load_from() ` method will try passing the current line of text to
287
286
each parser, which, in turn typically checks to see if the line begins with a
288
- particular commented (` // ` ) header command such as ` // must-compile-successfully `
289
- or ` // failure-status ` . Whitespace after the comment marker is optional.
287
+ particular commented (` //@ ` ) header command such as ` //@ must-compile-successfully `
288
+ or ` //@ failure-status ` . Whitespace after the comment marker is optional.
290
289
291
290
Parsers will override a given header command property's default value merely by
292
291
being specified in the test file as a header command or by having a parameter
0 commit comments