@@ -868,6 +868,7 @@ pub(crate) fn make_test(
868
868
file : String ,
869
869
rustdoc_test_options : Arc < IndividualTestOptions > ,
870
870
test_id : String ,
871
+ target_str : & str ,
871
872
) -> DocTest {
872
873
let outdir = Arc :: new ( if let Some ( ref path) = rustdoc_test_options. persist_doctests {
873
874
let mut path = path. clone ( ) ;
@@ -976,6 +977,12 @@ pub(crate) fn make_test(
976
977
( found_main, found_extern_crate, found_macro)
977
978
} )
978
979
} ) ;
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
+ } ;
979
986
let Ok ( ( mut main_fn_span, already_has_extern_crate, found_macro) ) = result else {
980
987
// If the parser panicked due to a fatal error, pass the test code through unchanged.
981
988
// The error will be reported during compilation.
@@ -987,7 +994,7 @@ pub(crate) fn make_test(
987
994
crates,
988
995
everything_else,
989
996
already_has_extern_crate : false ,
990
- ignore : false ,
997
+ ignore,
991
998
crate_name,
992
999
name,
993
1000
lang_string,
@@ -1024,7 +1031,7 @@ pub(crate) fn make_test(
1024
1031
crates,
1025
1032
everything_else,
1026
1033
already_has_extern_crate,
1027
- ignore : false ,
1034
+ ignore,
1028
1035
crate_name,
1029
1036
name,
1030
1037
lang_string,
@@ -1481,7 +1488,7 @@ impl Tester for Collector {
1481
1488
) ;
1482
1489
1483
1490
debug ! ( "creating test {name}: {test}" ) ;
1484
- let mut doctest = make_test (
1491
+ let doctest = make_test (
1485
1492
test,
1486
1493
Some ( crate_name) ,
1487
1494
edition,
@@ -1491,12 +1498,8 @@ impl Tester for Collector {
1491
1498
file,
1492
1499
Arc :: clone ( & self . rustdoc_test_options ) ,
1493
1500
test_id,
1501
+ & target_str,
1494
1502
) ;
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
- } ;
1500
1503
self . tests . add_doctest (
1501
1504
doctest,
1502
1505
& opts,
0 commit comments