@@ -732,10 +732,12 @@ struct CreateRunnableDoctests {
732
732
visited_tests : FxHashMap < ( String , usize ) , usize > ,
733
733
unused_extern_reports : Arc < Mutex < Vec < UnusedExterns > > > ,
734
734
compiling_test_count : AtomicUsize ,
735
+ can_merge_doctests : bool ,
735
736
}
736
737
737
738
impl CreateRunnableDoctests {
738
739
fn new ( rustdoc_options : RustdocOptions , opts : GlobalTestOptions ) -> CreateRunnableDoctests {
740
+ let can_merge_doctests = rustdoc_options. edition >= Edition :: Edition2024 ;
739
741
CreateRunnableDoctests {
740
742
standalone_tests : Vec :: new ( ) ,
741
743
mergeable_tests : FxHashMap :: default ( ) ,
@@ -744,6 +746,7 @@ impl CreateRunnableDoctests {
744
746
visited_tests : FxHashMap :: default ( ) ,
745
747
unused_extern_reports : Default :: default ( ) ,
746
748
compiling_test_count : AtomicUsize :: new ( 0 ) ,
749
+ can_merge_doctests,
747
750
}
748
751
}
749
752
@@ -773,7 +776,8 @@ impl CreateRunnableDoctests {
773
776
let edition = scraped_test. edition ( & self . rustdoc_options ) ;
774
777
let doctest =
775
778
DocTest :: new ( & scraped_test. text , Some ( & self . opts . crate_name ) , edition, Some ( test_id) ) ;
776
- let is_standalone = scraped_test. langstr . compile_fail
779
+ let is_standalone = !self . can_merge_doctests
780
+ || scraped_test. langstr . compile_fail
777
781
|| scraped_test. langstr . test_harness
778
782
|| self . rustdoc_options . nocapture
779
783
|| self . rustdoc_options . test_args . iter ( ) . any ( |arg| arg == "--show-output" )
0 commit comments