@@ -447,6 +447,7 @@ struct RunnableDocTest {
447
447
line : usize ,
448
448
edition : Edition ,
449
449
no_run : bool ,
450
+ is_multiple_tests : bool ,
450
451
}
451
452
452
453
impl RunnableDocTest {
@@ -459,7 +460,6 @@ fn run_test(
459
460
doctest : RunnableDocTest ,
460
461
rustdoc_options : & RustdocOptions ,
461
462
supports_color : bool ,
462
- is_multiple_tests : bool ,
463
463
report_unused_externs : impl Fn ( UnusedExterns ) ,
464
464
) -> Result < ( ) , TestFailure > {
465
465
let langstr = & doctest. langstr ;
@@ -480,7 +480,7 @@ fn run_test(
480
480
}
481
481
482
482
compiler. arg ( "--edition" ) . arg ( & doctest. edition . to_string ( ) ) ;
483
- if !is_multiple_tests {
483
+ if !doctest . is_multiple_tests {
484
484
// Setting these environment variables is unneeded if this is a merged doctest.
485
485
compiler. env ( "UNSTABLE_RUSTDOC_TEST_PATH" , & doctest. test_opts . path ) ;
486
486
compiler. env (
@@ -532,7 +532,7 @@ fn run_test(
532
532
533
533
// If this is a merged doctest, we need to write it into a file instead of using stdin
534
534
// because if the size of the merged doctests is too big, it'll simply break stdin.
535
- if is_multiple_tests {
535
+ if doctest . is_multiple_tests {
536
536
// It makes the compilation failure much faster if it is for a combined doctest.
537
537
compiler. arg ( "--error-format=short" ) ;
538
538
let input_file = doctest. path_for_merged_doctest ( ) ;
@@ -556,7 +556,7 @@ fn run_test(
556
556
debug ! ( "compiler invocation for doctest: {compiler:?}" ) ;
557
557
558
558
let mut child = compiler. spawn ( ) . expect ( "Failed to spawn rustc process" ) ;
559
- let output = if is_multiple_tests {
559
+ let output = if doctest . is_multiple_tests {
560
560
let status = child. wait ( ) . expect ( "Failed to wait" ) ;
561
561
process:: Output { status, stdout : Vec :: new ( ) , stderr : Vec :: new ( ) }
562
562
} else {
@@ -634,7 +634,7 @@ fn run_test(
634
634
cmd. arg ( & output_file) ;
635
635
} else {
636
636
cmd = Command :: new ( & output_file) ;
637
- if is_multiple_tests {
637
+ if doctest . is_multiple_tests {
638
638
cmd. arg ( "*doctest-bin-path" ) ;
639
639
cmd. arg ( & output_file) ;
640
640
}
@@ -643,7 +643,7 @@ fn run_test(
643
643
cmd. current_dir ( run_directory) ;
644
644
}
645
645
646
- let result = if is_multiple_tests || rustdoc_options. nocapture {
646
+ let result = if doctest . is_multiple_tests || rustdoc_options. nocapture {
647
647
cmd. status ( ) . map ( |status| process:: Output {
648
648
status,
649
649
stdout : Vec :: new ( ) ,
@@ -921,14 +921,10 @@ fn doctest_run_fn(
921
921
line : scraped_test. line ,
922
922
edition : scraped_test. edition ( & rustdoc_options) ,
923
923
no_run : scraped_test. no_run ( & rustdoc_options) ,
924
+ is_multiple_tests : false ,
924
925
} ;
925
- let res = run_test (
926
- runnable_test,
927
- & rustdoc_options,
928
- doctest. supports_color ,
929
- false ,
930
- report_unused_externs,
931
- ) ;
926
+ let res =
927
+ run_test ( runnable_test, & rustdoc_options, doctest. supports_color , report_unused_externs) ;
932
928
933
929
if let Err ( err) = res {
934
930
match err {
0 commit comments