@@ -943,26 +943,20 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig {
943
943
let vendor = & sess. target . target . target_vendor ;
944
944
let max_atomic_width = sess. target . target . max_atomic_width ( ) ;
945
945
946
- let fam = if let Some ( ref fam) = sess. target . target . options . target_family {
947
- Symbol :: intern ( fam)
948
- } else if sess. target . target . options . is_like_windows {
949
- Symbol :: intern ( "windows" )
950
- } else {
951
- Symbol :: intern ( "unix" )
952
- } ;
953
-
954
946
let mut ret = HashSet :: new ( ) ;
955
947
// Target bindings.
956
948
ret. insert ( ( Symbol :: intern ( "target_os" ) , Some ( Symbol :: intern ( os) ) ) ) ;
957
- ret. insert ( ( Symbol :: intern ( "target_family" ) , Some ( fam) ) ) ;
949
+ if let Some ( fam) = sess. target . target . options . target_family {
950
+ ret. insert ( ( Symbol :: intern ( "target_family" ) , Some ( fam) ) ) ;
951
+ if fam == "windows" || fam == "unix" {
952
+ ret. insert ( ( fam, None ) ) ;
953
+ }
954
+ }
958
955
ret. insert ( ( Symbol :: intern ( "target_arch" ) , Some ( Symbol :: intern ( arch) ) ) ) ;
959
956
ret. insert ( ( Symbol :: intern ( "target_endian" ) , Some ( Symbol :: intern ( end) ) ) ) ;
960
957
ret. insert ( ( Symbol :: intern ( "target_pointer_width" ) , Some ( Symbol :: intern ( wordsz) ) ) ) ;
961
958
ret. insert ( ( Symbol :: intern ( "target_env" ) , Some ( Symbol :: intern ( env) ) ) ) ;
962
959
ret. insert ( ( Symbol :: intern ( "target_vendor" ) , Some ( Symbol :: intern ( vendor) ) ) ) ;
963
- if fam == "windows" || fam == "unix" {
964
- ret. insert ( ( fam, None ) ) ;
965
- }
966
960
if sess. target . target . options . has_elf_tls {
967
961
ret. insert ( ( Symbol :: intern ( "target_thread_local" ) , None ) ) ;
968
962
}
0 commit comments