@@ -428,8 +428,8 @@ impl<'test> TestCx<'test> {
428428 . arg ( & aux_dir)
429429 . arg ( "-A" )
430430 . arg ( "internal_features" )
431- . args ( & self . props . compile_flags )
432431 . envs ( self . props . rustc_env . clone ( ) ) ;
432+ self . add_common_args ( & mut rustc) ;
433433 self . maybe_add_external_args ( & mut rustc, & self . config . target_rustcflags ) ;
434434
435435 let src = match read_from {
@@ -534,7 +534,7 @@ impl<'test> TestCx<'test> {
534534 . arg ( "internal_features" ) ;
535535 self . set_revision_flags ( & mut rustc) ;
536536 self . maybe_add_external_args ( & mut rustc, & self . config . target_rustcflags ) ;
537- rustc . args ( & self . props . compile_flags ) ;
537+ self . add_common_args ( & mut rustc ) ;
538538
539539 self . compose_and_run_compiler ( rustc, Some ( src) , self . testpaths )
540540 }
@@ -937,8 +937,8 @@ impl<'test> TestCx<'test> {
937937 . arg ( & self . testpaths . file )
938938 . arg ( "-A" )
939939 . arg ( "internal_features" )
940- . args ( & self . props . compile_flags )
941940 . args ( & self . props . doc_flags ) ;
941+ self . add_common_args ( & mut rustdoc) ;
942942
943943 if self . config . mode == RustdocJson {
944944 rustdoc. arg ( "--output-format" ) . arg ( "json" ) . arg ( "-Zunstable-options" ) ;
@@ -1242,6 +1242,9 @@ impl<'test> TestCx<'test> {
12421242 self . props . from_aux_file ( & aux_testpaths. file , self . revision , self . config ) ;
12431243 if aux_type == Some ( AuxType :: ProcMacro ) {
12441244 aux_props. force_host = true ;
1245+ if aux_props. edition . is_none ( ) {
1246+ aux_props. edition = Some ( "2024" . to_string ( ) ) ;
1247+ }
12451248 }
12461249 let mut aux_dir = aux_dir. to_path_buf ( ) ;
12471250 if aux_type == Some ( AuxType :: Bin ) {
@@ -1731,7 +1734,7 @@ impl<'test> TestCx<'test> {
17311734 }
17321735 }
17331736
1734- rustc . args ( & self . props . compile_flags ) ;
1737+ self . add_common_args ( & mut rustc ) ;
17351738
17361739 // FIXME(jieyouxu): we should report a fatal error or warning if user wrote `-Cpanic=` with
17371740 // something that's not `abort`, however, by moving this last we should override previous
@@ -1745,6 +1748,13 @@ impl<'test> TestCx<'test> {
17451748 rustc
17461749 }
17471750
1751+ fn add_common_args ( & self , cmd : & mut Command ) {
1752+ cmd. args ( & self . props . compile_flags ) ;
1753+ if let Some ( edition) = & self . props . edition {
1754+ cmd. args ( & [ "--edition" , edition. as_str ( ) ] ) ;
1755+ }
1756+ }
1757+
17481758 fn make_exe_name ( & self ) -> PathBuf {
17491759 // Using a single letter here to keep the path length down for
17501760 // Windows. Some test names get very long. rustc creates `rcgu`
0 commit comments