@@ -12,7 +12,7 @@ use rustc_data_structures::fx::FxHashSet;
1212use rustc_data_structures:: impl_stable_hash_via_hash;
1313
1414use rustc_target:: abi:: { Align , TargetDataLayout } ;
15- use rustc_target:: spec:: { SplitDebuginfo , Target , TargetTriple } ;
15+ use rustc_target:: spec:: { SplitDebuginfo , Target , TargetTriple , TargetWarnings } ;
1616
1717use rustc_serialize:: json;
1818
@@ -899,9 +899,11 @@ pub(super) fn build_target_config(
899899 target_override : Option < Target > ,
900900 sysroot : & PathBuf ,
901901) -> Target {
902- let target_result =
903- target_override. map_or_else ( || Target :: search ( & opts. target_triple , sysroot) , Ok ) ;
904- let target = target_result. unwrap_or_else ( |e| {
902+ let target_result = target_override. map_or_else (
903+ || Target :: search ( & opts. target_triple , sysroot) ,
904+ |t| Ok ( ( t, TargetWarnings :: empty ( ) ) ) ,
905+ ) ;
906+ let ( target, target_warnings) = target_result. unwrap_or_else ( |e| {
905907 early_error (
906908 opts. error_format ,
907909 & format ! (
@@ -911,6 +913,9 @@ pub(super) fn build_target_config(
911913 ) ,
912914 )
913915 } ) ;
916+ for warning in target_warnings. warning_messages ( ) {
917+ early_warn ( opts. error_format , & warning)
918+ }
914919
915920 if !matches ! ( target. pointer_width, 16 | 32 | 64 ) {
916921 early_error (
0 commit comments