@@ -868,6 +868,7 @@ pub(crate) fn make_test(
868868 file : String ,
869869 rustdoc_test_options : Arc < IndividualTestOptions > ,
870870 test_id : String ,
871+ target_str : & str ,
871872) -> DocTest {
872873 let outdir = Arc :: new ( if let Some ( ref path) = rustdoc_test_options. persist_doctests {
873874 let mut path = path. clone ( ) ;
@@ -976,6 +977,12 @@ pub(crate) fn make_test(
976977 ( found_main, found_extern_crate, found_macro)
977978 } )
978979 } ) ;
980+
981+ let ignore = match lang_string. ignore {
982+ Ignore :: All => true ,
983+ Ignore :: None => false ,
984+ Ignore :: Some ( ref ignores) => ignores. iter ( ) . any ( |s| target_str. contains ( s) ) ,
985+ } ;
979986 let Ok ( ( mut main_fn_span, already_has_extern_crate, found_macro) ) = result else {
980987 // If the parser panicked due to a fatal error, pass the test code through unchanged.
981988 // The error will be reported during compilation.
@@ -987,7 +994,7 @@ pub(crate) fn make_test(
987994 crates,
988995 everything_else,
989996 already_has_extern_crate : false ,
990- ignore : false ,
997+ ignore,
991998 crate_name,
992999 name,
9931000 lang_string,
@@ -1024,7 +1031,7 @@ pub(crate) fn make_test(
10241031 crates,
10251032 everything_else,
10261033 already_has_extern_crate,
1027- ignore : false ,
1034+ ignore,
10281035 crate_name,
10291036 name,
10301037 lang_string,
@@ -1481,7 +1488,7 @@ impl Tester for Collector {
14811488 ) ;
14821489
14831490 debug ! ( "creating test {name}: {test}" ) ;
1484- let mut doctest = make_test (
1491+ let doctest = make_test (
14851492 test,
14861493 Some ( crate_name) ,
14871494 edition,
@@ -1491,12 +1498,8 @@ impl Tester for Collector {
14911498 file,
14921499 Arc :: clone ( & self . rustdoc_test_options ) ,
14931500 test_id,
1501+ & target_str,
14941502 ) ;
1495- doctest. ignore = match doctest. lang_string . ignore {
1496- Ignore :: All => true ,
1497- Ignore :: None => false ,
1498- Ignore :: Some ( ref ignores) => ignores. iter ( ) . any ( |s| target_str. contains ( s) ) ,
1499- } ;
15001503 self . tests . add_doctest (
15011504 doctest,
15021505 & opts,
0 commit comments