@@ -8,7 +8,7 @@ use crate::clean;
88use crate :: clean:: * ;
99use crate :: core:: DocContext ;
1010use crate :: fold:: DocFolder ;
11- use crate :: html:: markdown:: { find_testable_code, ErrorCodes , LangString } ;
11+ use crate :: html:: markdown:: { find_testable_code, ErrorCodes , Ignore , LangString } ;
1212use rustc_session:: lint;
1313
1414pub const CHECK_PRIVATE_ITEMS_DOC_TESTS : Pass = Pass {
@@ -48,15 +48,11 @@ pub(crate) struct Tests {
4848 pub ( crate ) found_tests : usize ,
4949}
5050
51- impl Tests {
52- pub ( crate ) fn new ( ) -> Tests {
53- Tests { found_tests : 0 }
54- }
55- }
56-
5751impl crate :: doctest:: Tester for Tests {
58- fn add_test ( & mut self , _: String , _: LangString , _: usize ) {
59- self . found_tests += 1 ;
52+ fn add_test ( & mut self , _: String , config : LangString , _: usize ) {
53+ if config. rust && config. ignore == Ignore :: None {
54+ self . found_tests += 1 ;
55+ }
6056 }
6157}
6258
@@ -85,7 +81,7 @@ pub fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item) {
8581 }
8682 } ;
8783
88- let mut tests = Tests :: new ( ) ;
84+ let mut tests = Tests { found_tests : 0 } ;
8985
9086 find_testable_code ( & dox, & mut tests, ErrorCodes :: No , false , None ) ;
9187
0 commit comments