@@ -8,15 +8,17 @@ LL | let _closure_expr = #[coverage(off)] || ();
8
8
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
9
9
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10
10
11
- error[E0788]: attribute should be applied to a function definition or closure
11
+ error[E0788]: coverage attribute not allowed here
12
12
--> $DIR/allowed-positions.rs:14:1
13
13
|
14
14
LL | #[coverage(off)]
15
15
| ^^^^^^^^^^^^^^^^
16
16
LL | type MyTypeAlias = ();
17
- | ---------------------- not a function or closure
17
+ | ---------------------- not a function, impl block, or module
18
+ |
19
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
18
20
19
- error[E0788]: attribute should be applied to a function definition or closure
21
+ error[E0788]: coverage attribute not allowed here
20
22
--> $DIR/allowed-positions.rs:17:1
21
23
|
22
24
LL | #[coverage(off)]
@@ -27,9 +29,11 @@ LL | | const TRAIT_ASSOC_CONST: u32;
27
29
... |
28
30
LL | | fn trait_assoc_fn();
29
31
LL | | }
30
- | |_- not a function or closure
32
+ | |_- not a function, impl block, or module
33
+ |
34
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
31
35
32
- error[E0788]: attribute should be applied to a function definition or closure
36
+ error[E0788]: coverage attribute not allowed here
33
37
--> $DIR/allowed-positions.rs:61:1
34
38
|
35
39
LL | #[coverage(off)]
@@ -38,119 +42,149 @@ LL | / struct MyStruct {
38
42
LL | | #[coverage(off)]
39
43
LL | | field: u32,
40
44
LL | | }
41
- | |_- not a function or closure
45
+ | |_- not a function, impl block, or module
46
+ |
47
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
42
48
43
- error[E0788]: attribute should be applied to a function definition or closure
49
+ error[E0788]: coverage attribute not allowed here
44
50
--> $DIR/allowed-positions.rs:63:5
45
51
|
46
52
LL | #[coverage(off)]
47
53
| ^^^^^^^^^^^^^^^^
48
54
LL | field: u32,
49
- | ---------- not a function or closure
55
+ | ---------- not a function, impl block, or module
56
+ |
57
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
50
58
51
- error[E0788]: attribute should be applied to a function definition or closure
59
+ error[E0788]: coverage attribute not allowed here
52
60
--> $DIR/allowed-positions.rs:88:5
53
61
|
54
62
LL | #[coverage(off)]
55
63
| ^^^^^^^^^^^^^^^^
56
64
LL | let _ = ();
57
- | ----------- not a function or closure
65
+ | ----------- not a function, impl block, or module
66
+ |
67
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
58
68
59
- error[E0788]: attribute should be applied to a function definition or closure
69
+ error[E0788]: coverage attribute not allowed here
60
70
--> $DIR/allowed-positions.rs:94:5
61
71
|
62
72
LL | #[coverage(off)]
63
73
| ^^^^^^^^^^^^^^^^
64
74
LL | let _let_closure = || ();
65
- | ------------------------- not a function or closure
75
+ | ------------------------- not a function, impl block, or module
76
+ |
77
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
66
78
67
- error[E0788]: attribute should be applied to a function definition or closure
79
+ error[E0788]: coverage attribute not allowed here
68
80
--> $DIR/allowed-positions.rs:110:9
69
81
|
70
82
LL | #[coverage(off)]
71
83
| ^^^^^^^^^^^^^^^^
72
84
LL | () => (),
73
- | -------- not a function or closure
85
+ | -------- not a function, impl block, or module
86
+ |
87
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
74
88
75
- error[E0788]: attribute should be applied to a function definition or closure
89
+ error[E0788]: coverage attribute not allowed here
76
90
--> $DIR/allowed-positions.rs:114:5
77
91
|
78
92
LL | #[coverage(off)]
79
93
| ^^^^^^^^^^^^^^^^
80
94
LL | return ();
81
- | --------- not a function or closure
95
+ | --------- not a function, impl block, or module
96
+ |
97
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
82
98
83
- error[E0788]: attribute should be applied to a function definition or closure
99
+ error[E0788]: coverage attribute not allowed here
84
100
--> $DIR/allowed-positions.rs:19:5
85
101
|
86
102
LL | #[coverage(off)]
87
103
| ^^^^^^^^^^^^^^^^
88
104
LL | const TRAIT_ASSOC_CONST: u32;
89
- | ----------------------------- not a function or closure
105
+ | ----------------------------- not a function, impl block, or module
106
+ |
107
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
90
108
91
- error[E0788]: attribute should be applied to a function definition or closure
109
+ error[E0788]: coverage attribute not allowed here
92
110
--> $DIR/allowed-positions.rs:22:5
93
111
|
94
112
LL | #[coverage(off)]
95
113
| ^^^^^^^^^^^^^^^^
96
114
LL | type TraitAssocType;
97
- | -------------------- not a function or closure
115
+ | -------------------- not a function, impl block, or module
116
+ |
117
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
98
118
99
- error[E0788]: attribute should be applied to a function definition or closure
119
+ error[E0788]: coverage attribute not allowed here
100
120
--> $DIR/allowed-positions.rs:25:5
101
121
|
102
122
LL | #[coverage(off)]
103
123
| ^^^^^^^^^^^^^^^^
104
124
LL | fn trait_method(&self);
105
- | ----------------------- not a function or closure
125
+ | ----------------------- function has no body
126
+ |
127
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
106
128
107
- error[E0788]: attribute should be applied to a function definition or closure
129
+ error[E0788]: coverage attribute not allowed here
108
130
--> $DIR/allowed-positions.rs:31:5
109
131
|
110
132
LL | #[coverage(off)]
111
133
| ^^^^^^^^^^^^^^^^
112
134
LL | fn trait_assoc_fn();
113
- | -------------------- not a function or closure
135
+ | -------------------- function has no body
136
+ |
137
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
114
138
115
- error[E0788]: attribute should be applied to a function definition or closure
139
+ error[E0788]: coverage attribute not allowed here
116
140
--> $DIR/allowed-positions.rs:39:5
117
141
|
118
142
LL | #[coverage(off)]
119
143
| ^^^^^^^^^^^^^^^^
120
144
LL | type TraitAssocType = Self;
121
- | --------------------------- not a function or closure
145
+ | --------------------------- not a function, impl block, or module
146
+ |
147
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
122
148
123
- error[E0788]: attribute should be applied to a function definition or closure
149
+ error[E0788]: coverage attribute not allowed here
124
150
--> $DIR/allowed-positions.rs:56:5
125
151
|
126
152
LL | #[coverage(off)]
127
153
| ^^^^^^^^^^^^^^^^
128
154
LL | type T = impl Copy;
129
- | ------------------- not a function or closure
155
+ | ------------------- not a function, impl block, or module
156
+ |
157
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
130
158
131
- error[E0788]: attribute should be applied to a function definition or closure
159
+ error[E0788]: coverage attribute not allowed here
132
160
--> $DIR/allowed-positions.rs:76:5
133
161
|
134
162
LL | #[coverage(off)]
135
163
| ^^^^^^^^^^^^^^^^
136
164
LL | static X: u32;
137
- | -------------- not a function or closure
165
+ | -------------- not a function, impl block, or module
166
+ |
167
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
138
168
139
- error[E0788]: attribute should be applied to a function definition or closure
169
+ error[E0788]: coverage attribute not allowed here
140
170
--> $DIR/allowed-positions.rs:79:5
141
171
|
142
172
LL | #[coverage(off)]
143
173
| ^^^^^^^^^^^^^^^^
144
174
LL | type T;
145
- | ------- not a function or closure
175
+ | ------- not a function, impl block, or module
176
+ |
177
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
146
178
147
- error[E0788]: attribute should be applied to a function definition or closure
179
+ error[E0788]: coverage attribute not allowed here
148
180
--> $DIR/allowed-positions.rs:82:5
149
181
|
150
182
LL | #[coverage(off)]
151
183
| ^^^^^^^^^^^^^^^^
152
184
LL | fn foreign_fn();
153
- | ---------------- not a function or closure
185
+ | ---------------- function has no body
186
+ |
187
+ = help: coverage attribute can be applied to a function (with body), impl block, or module
154
188
155
189
error: aborting due to 18 previous errors
156
190
0 commit comments