@@ -173,38 +173,39 @@ fn check_error_codes_docs(
173173 return ;
174174 }
175175
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 {
178179 verbose_print ! (
179180 verbose,
180181 "warning: Error code `{err_code}` uses the ignore header. This should not be used, add the error code to the \
181182 `IGNORE_DOCTEST_CHECK` constant instead."
182183 ) ;
183184 }
184- if has_test . 3 {
185+ if emit_no_longer_warning {
185186 no_longer_emitted_codes. push ( err_code. to_owned ( ) ) ;
186187 verbose_print ! (
187188 verbose,
188189 "warning: Error code `{err_code}` is no longer emitted and should be removed entirely."
189190 ) ;
190191 }
191- if !has_test . 0 {
192+ if !found_code_example {
192193 verbose_print ! (
193194 verbose,
194195 "warning: Error code `{err_code}` doesn't have a code example, all error codes are expected to have one \
195196 (even if untested)."
196197 ) ;
197198 }
198199
199- let test_ignored = IGNORE_DOCTEST_CHECK . contains ( & err_code) ;
200+ let test_ignored = IGNORE_DOCTEST_CHECK . contains ( & & err_code) ;
200201
201202 // 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 {
203204 errors. push ( format ! (
204205 "`{}` doesn't use its own error code in compile_fail example" ,
205206 path. display( ) ,
206207 ) ) ;
207- } else if has_test . 1 && test_ignored {
208+ } else if found_proper_doctest && test_ignored {
208209 errors. push ( format ! (
209210 "`{}` has a compile_fail doctest with its own error code, it shouldn't \
210211 be listed in `IGNORE_DOCTEST_CHECK`",
0 commit comments