@@ -8,7 +8,7 @@ use rustc_session::config::{build_configuration, build_session_options, to_crate
8
8
use rustc_session:: config:: { rustc_optgroups, ErrorOutputType , ExternLocation , Options , Passes } ;
9
9
use rustc_session:: config:: { CFGuard , ExternEntry , LinkerPluginLto , LtoCli , SwitchWithOptPath } ;
10
10
use rustc_session:: config:: {
11
- Externs , OutputType , OutputTypes , SymbolManglingVersion , WasiExecModel ,
11
+ Externs , OutputType , OutputTypes , PreferDynamicSet , SymbolManglingVersion , WasiExecModel ,
12
12
} ;
13
13
use rustc_session:: lint:: Level ;
14
14
use rustc_session:: search_paths:: SearchPath ;
@@ -582,14 +582,24 @@ fn test_codegen_options_tracking_hash() {
582
582
tracked ! ( overflow_checks, Some ( true ) ) ;
583
583
tracked ! ( panic, Some ( PanicStrategy :: Abort ) ) ;
584
584
tracked ! ( passes, vec![ String :: from( "1" ) , String :: from( "2" ) ] ) ;
585
- tracked ! ( prefer_dynamic, true ) ;
585
+ tracked ! ( prefer_dynamic, PreferDynamicSet :: every_crate ( ) ) ;
586
586
tracked ! ( profile_generate, SwitchWithOptPath :: Enabled ( None ) ) ;
587
587
tracked ! ( profile_use, Some ( PathBuf :: from( "abc" ) ) ) ;
588
588
tracked ! ( relocation_model, Some ( RelocModel :: Pic ) ) ;
589
589
tracked ! ( soft_float, true ) ;
590
590
tracked ! ( split_debuginfo, Some ( SplitDebuginfo :: Packed ) ) ;
591
591
tracked ! ( target_cpu, Some ( String :: from( "abc" ) ) ) ;
592
592
tracked ! ( target_feature, String :: from( "all the features, all of them" ) ) ;
593
+
594
+ // Check that changes to the ordering of input to `-C prefer-dynamic=crate,...`
595
+ // does not cause the dependency tracking hash to change.
596
+ {
597
+ let mut v1 = Options :: default ( ) ;
598
+ let mut v2 = Options :: default ( ) ;
599
+ v1. cg . prefer_dynamic = PreferDynamicSet :: subset ( [ "a" , "b" ] . iter ( ) ) ;
600
+ v2. cg . prefer_dynamic = PreferDynamicSet :: subset ( [ "b" , "a" ] . iter ( ) ) ;
601
+ assert_same_hash ( & v1, & v2) ;
602
+ }
593
603
}
594
604
595
605
#[ test]
0 commit comments