File tree 2 files changed +45
-0
lines changed
2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ #![ feature( coverage_attribute) ]
2
+ //@ edition: 2021
3
+
4
+ // Check that yes/no in `#[coverage(yes)]` and `#[coverage(no)]` must be bare
5
+ // words, not part of a more complicated substructure.
6
+
7
+ #[ coverage( yes( milord) ) ] //~ ERROR expected `coverage(off)` or `coverage(on)`
8
+ fn yes_list ( ) { }
9
+
10
+ #[ coverage( no( milord) ) ] //~ ERROR expected `coverage(off)` or `coverage(on)`
11
+ fn no_list ( ) { }
12
+
13
+ #[ coverage( yes = "milord" ) ] //~ ERROR expected `coverage(off)` or `coverage(on)`
14
+ fn yes_key ( ) { }
15
+
16
+ #[ coverage( no = "milord" ) ] //~ ERROR expected `coverage(off)` or `coverage(on)`
17
+ fn no_key ( ) { }
18
+
19
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: expected `coverage(off)` or `coverage(on)`
2
+ --> $DIR/subword.rs:7:1
3
+ |
4
+ LL | #[coverage(yes(milord))]
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
6
+
7
+ error: expected `coverage(off)` or `coverage(on)`
8
+ --> $DIR/subword.rs:10:1
9
+ |
10
+ LL | #[coverage(no(milord))]
11
+ | ^^^^^^^^^^^^^^^^^^^^^^^
12
+
13
+ error: expected `coverage(off)` or `coverage(on)`
14
+ --> $DIR/subword.rs:13:1
15
+ |
16
+ LL | #[coverage(yes = "milord")]
17
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
+
19
+ error: expected `coverage(off)` or `coverage(on)`
20
+ --> $DIR/subword.rs:16:1
21
+ |
22
+ LL | #[coverage(no = "milord")]
23
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
24
+
25
+ error: aborting due to 4 previous errors
26
+
You can’t perform that action at this time.
0 commit comments