@@ -173,38 +173,39 @@ fn check_error_codes_docs(
173
173
return ;
174
174
}
175
175
176
- let ( found_code_example, found_proper_doctest, emit_ignore_warning, emit_no_longer_warning) = check_explanation_has_doctest ( & contents, & err_code) ;
177
- if has_test. 2 {
176
+ let ( found_code_example, found_proper_doctest, emit_ignore_warning, emit_no_longer_warning) =
177
+ check_explanation_has_doctest ( & contents, & err_code) ;
178
+ if emit_ignore_warning {
178
179
verbose_print ! (
179
180
verbose,
180
181
"warning: Error code `{err_code}` uses the ignore header. This should not be used, add the error code to the \
181
182
`IGNORE_DOCTEST_CHECK` constant instead."
182
183
) ;
183
184
}
184
- if has_test . 3 {
185
+ if emit_no_longer_warning {
185
186
no_longer_emitted_codes. push ( err_code. to_owned ( ) ) ;
186
187
verbose_print ! (
187
188
verbose,
188
189
"warning: Error code `{err_code}` is no longer emitted and should be removed entirely."
189
190
) ;
190
191
}
191
- if !has_test . 0 {
192
+ if !found_code_example {
192
193
verbose_print ! (
193
194
verbose,
194
195
"warning: Error code `{err_code}` doesn't have a code example, all error codes are expected to have one \
195
196
(even if untested)."
196
197
) ;
197
198
}
198
199
199
- let test_ignored = IGNORE_DOCTEST_CHECK . contains ( & err_code) ;
200
+ let test_ignored = IGNORE_DOCTEST_CHECK . contains ( & & err_code) ;
200
201
201
202
// Check that the explanation has a doctest, and if it shouldn't, that it doesn't
202
- if !has_test . 1 && !test_ignored {
203
+ if !found_proper_doctest && !test_ignored {
203
204
errors. push ( format ! (
204
205
"`{}` doesn't use its own error code in compile_fail example" ,
205
206
path. display( ) ,
206
207
) ) ;
207
- } else if has_test . 1 && test_ignored {
208
+ } else if found_proper_doctest && test_ignored {
208
209
errors. push ( format ! (
209
210
"`{}` has a compile_fail doctest with its own error code, it shouldn't \
210
211
be listed in `IGNORE_DOCTEST_CHECK`",
0 commit comments