@@ -8,15 +8,17 @@ LL | let _closure_expr = #[coverage(off)] || ();
88 = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
99 = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010
11- error[E0788]: attribute should be applied to a function definition or closure
11+ error[E0788]: coverage attribute not allowed here
1212 --> $DIR/allowed-positions.rs:14:1
1313 |
1414LL | #[coverage(off)]
1515 | ^^^^^^^^^^^^^^^^
1616LL | 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
1820
19- error[E0788]: attribute should be applied to a function definition or closure
21+ error[E0788]: coverage attribute not allowed here
2022 --> $DIR/allowed-positions.rs:17:1
2123 |
2224LL | #[coverage(off)]
@@ -27,9 +29,11 @@ LL | | const TRAIT_ASSOC_CONST: u32;
2729... |
2830LL | | fn trait_assoc_fn();
2931LL | | }
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
3135
32- error[E0788]: attribute should be applied to a function definition or closure
36+ error[E0788]: coverage attribute not allowed here
3337 --> $DIR/allowed-positions.rs:61:1
3438 |
3539LL | #[coverage(off)]
@@ -38,119 +42,149 @@ LL | / struct MyStruct {
3842LL | | #[coverage(off)]
3943LL | | field: u32,
4044LL | | }
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
4248
43- error[E0788]: attribute should be applied to a function definition or closure
49+ error[E0788]: coverage attribute not allowed here
4450 --> $DIR/allowed-positions.rs:63:5
4551 |
4652LL | #[coverage(off)]
4753 | ^^^^^^^^^^^^^^^^
4854LL | 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
5058
51- error[E0788]: attribute should be applied to a function definition or closure
59+ error[E0788]: coverage attribute not allowed here
5260 --> $DIR/allowed-positions.rs:88:5
5361 |
5462LL | #[coverage(off)]
5563 | ^^^^^^^^^^^^^^^^
5664LL | 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
5868
59- error[E0788]: attribute should be applied to a function definition or closure
69+ error[E0788]: coverage attribute not allowed here
6070 --> $DIR/allowed-positions.rs:94:5
6171 |
6272LL | #[coverage(off)]
6373 | ^^^^^^^^^^^^^^^^
6474LL | 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
6678
67- error[E0788]: attribute should be applied to a function definition or closure
79+ error[E0788]: coverage attribute not allowed here
6880 --> $DIR/allowed-positions.rs:110:9
6981 |
7082LL | #[coverage(off)]
7183 | ^^^^^^^^^^^^^^^^
7284LL | () => (),
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
7488
75- error[E0788]: attribute should be applied to a function definition or closure
89+ error[E0788]: coverage attribute not allowed here
7690 --> $DIR/allowed-positions.rs:114:5
7791 |
7892LL | #[coverage(off)]
7993 | ^^^^^^^^^^^^^^^^
8094LL | 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
8298
83- error[E0788]: attribute should be applied to a function definition or closure
99+ error[E0788]: coverage attribute not allowed here
84100 --> $DIR/allowed-positions.rs:19:5
85101 |
86102LL | #[coverage(off)]
87103 | ^^^^^^^^^^^^^^^^
88104LL | 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
90108
91- error[E0788]: attribute should be applied to a function definition or closure
109+ error[E0788]: coverage attribute not allowed here
92110 --> $DIR/allowed-positions.rs:22:5
93111 |
94112LL | #[coverage(off)]
95113 | ^^^^^^^^^^^^^^^^
96114LL | 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
98118
99- error[E0788]: attribute should be applied to a function definition or closure
119+ error[E0788]: coverage attribute not allowed here
100120 --> $DIR/allowed-positions.rs:25:5
101121 |
102122LL | #[coverage(off)]
103123 | ^^^^^^^^^^^^^^^^
104124LL | 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
106128
107- error[E0788]: attribute should be applied to a function definition or closure
129+ error[E0788]: coverage attribute not allowed here
108130 --> $DIR/allowed-positions.rs:31:5
109131 |
110132LL | #[coverage(off)]
111133 | ^^^^^^^^^^^^^^^^
112134LL | 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
114138
115- error[E0788]: attribute should be applied to a function definition or closure
139+ error[E0788]: coverage attribute not allowed here
116140 --> $DIR/allowed-positions.rs:39:5
117141 |
118142LL | #[coverage(off)]
119143 | ^^^^^^^^^^^^^^^^
120144LL | 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
122148
123- error[E0788]: attribute should be applied to a function definition or closure
149+ error[E0788]: coverage attribute not allowed here
124150 --> $DIR/allowed-positions.rs:56:5
125151 |
126152LL | #[coverage(off)]
127153 | ^^^^^^^^^^^^^^^^
128154LL | 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
130158
131- error[E0788]: attribute should be applied to a function definition or closure
159+ error[E0788]: coverage attribute not allowed here
132160 --> $DIR/allowed-positions.rs:76:5
133161 |
134162LL | #[coverage(off)]
135163 | ^^^^^^^^^^^^^^^^
136164LL | 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
138168
139- error[E0788]: attribute should be applied to a function definition or closure
169+ error[E0788]: coverage attribute not allowed here
140170 --> $DIR/allowed-positions.rs:79:5
141171 |
142172LL | #[coverage(off)]
143173 | ^^^^^^^^^^^^^^^^
144174LL | 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
146178
147- error[E0788]: attribute should be applied to a function definition or closure
179+ error[E0788]: coverage attribute not allowed here
148180 --> $DIR/allowed-positions.rs:82:5
149181 |
150182LL | #[coverage(off)]
151183 | ^^^^^^^^^^^^^^^^
152184LL | 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
154188
155189error: aborting due to 18 previous errors
156190
0 commit comments