@@ -428,8 +428,8 @@ impl<'test> TestCx<'test> {
428
428
. arg ( & aux_dir)
429
429
. arg ( "-A" )
430
430
. arg ( "internal_features" )
431
- . args ( & self . props . compile_flags )
432
431
. envs ( self . props . rustc_env . clone ( ) ) ;
432
+ self . add_common_args ( & mut rustc) ;
433
433
self . maybe_add_external_args ( & mut rustc, & self . config . target_rustcflags ) ;
434
434
435
435
let src = match read_from {
@@ -534,7 +534,7 @@ impl<'test> TestCx<'test> {
534
534
. arg ( "internal_features" ) ;
535
535
self . set_revision_flags ( & mut rustc) ;
536
536
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 ) ;
538
538
539
539
self . compose_and_run_compiler ( rustc, Some ( src) , self . testpaths )
540
540
}
@@ -937,8 +937,8 @@ impl<'test> TestCx<'test> {
937
937
. arg ( & self . testpaths . file )
938
938
. arg ( "-A" )
939
939
. arg ( "internal_features" )
940
- . args ( & self . props . compile_flags )
941
940
. args ( & self . props . doc_flags ) ;
941
+ self . add_common_args ( & mut rustdoc) ;
942
942
943
943
if self . config . mode == RustdocJson {
944
944
rustdoc. arg ( "--output-format" ) . arg ( "json" ) . arg ( "-Zunstable-options" ) ;
@@ -1242,6 +1242,9 @@ impl<'test> TestCx<'test> {
1242
1242
self . props . from_aux_file ( & aux_testpaths. file , self . revision , self . config ) ;
1243
1243
if aux_type == Some ( AuxType :: ProcMacro ) {
1244
1244
aux_props. force_host = true ;
1245
+ if aux_props. edition . is_none ( ) {
1246
+ aux_props. edition = Some ( "2024" . to_string ( ) ) ;
1247
+ }
1245
1248
}
1246
1249
let mut aux_dir = aux_dir. to_path_buf ( ) ;
1247
1250
if aux_type == Some ( AuxType :: Bin ) {
@@ -1731,7 +1734,7 @@ impl<'test> TestCx<'test> {
1731
1734
}
1732
1735
}
1733
1736
1734
- rustc . args ( & self . props . compile_flags ) ;
1737
+ self . add_common_args ( & mut rustc ) ;
1735
1738
1736
1739
// FIXME(jieyouxu): we should report a fatal error or warning if user wrote `-Cpanic=` with
1737
1740
// something that's not `abort`, however, by moving this last we should override previous
@@ -1745,6 +1748,13 @@ impl<'test> TestCx<'test> {
1745
1748
rustc
1746
1749
}
1747
1750
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
+
1748
1758
fn make_exe_name ( & self ) -> PathBuf {
1749
1759
// Using a single letter here to keep the path length down for
1750
1760
// Windows. Some test names get very long. rustc creates `rcgu`
0 commit comments