@@ -894,6 +894,7 @@ pub const fn default_lib_output() -> CrateType {
894
894
895
895
fn default_configuration ( sess : & Session ) -> CrateConfig {
896
896
// NOTE: This should be kept in sync with `CrateCheckConfig::fill_well_known` below.
897
+ let tar = & sess. opts . target_triple . triple ( ) ;
897
898
let end = & sess. target . endian ;
898
899
let arch = & sess. target . arch ;
899
900
let wordsz = sess. target . pointer_width . to_string ( ) ;
@@ -909,8 +910,10 @@ fn default_configuration(sess: &Session) -> CrateConfig {
909
910
} ) ;
910
911
911
912
let mut ret = FxHashSet :: default ( ) ;
912
- ret. reserve ( 7 ) ; // the minimum number of insertions
913
+ ret. reserve ( 9 ) ; // the minimum number of insertions
914
+
913
915
// Target bindings.
916
+ ret. insert ( ( sym:: target, Some ( Symbol :: intern ( tar) ) ) ) ;
914
917
ret. insert ( ( sym:: target_os, Some ( Symbol :: intern ( os) ) ) ) ;
915
918
for fam in sess. target . families . as_ref ( ) {
916
919
ret. insert ( ( sym:: target_family, Some ( Symbol :: intern ( fam) ) ) ) ;
@@ -1031,6 +1034,7 @@ impl CrateCheckConfig {
1031
1034
// rustc
1032
1035
sym:: unix,
1033
1036
sym:: windows,
1037
+ sym:: target,
1034
1038
sym:: target_os,
1035
1039
sym:: target_family,
1036
1040
sym:: target_arch,
@@ -1120,9 +1124,11 @@ impl CrateCheckConfig {
1120
1124
. extend ( atomic_values) ;
1121
1125
1122
1126
// Target specific values
1123
- for target in
1124
- TARGETS . iter ( ) . map ( |target| Target :: expect_builtin ( & TargetTriple :: from_triple ( target) ) )
1127
+ for ( name, target) in TARGETS
1128
+ . iter ( )
1129
+ . map ( |target| ( target, Target :: expect_builtin ( & TargetTriple :: from_triple ( target) ) ) )
1125
1130
{
1131
+ self . values_valid . entry ( sym:: target) . or_default ( ) . insert ( Symbol :: intern ( & name) ) ;
1126
1132
self . values_valid
1127
1133
. entry ( sym:: target_os)
1128
1134
. or_default ( )
0 commit comments