@@ -967,7 +967,6 @@ fn default_emitter(
967967#[ allow( rustc:: bad_opt_access) ]
968968#[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
969969pub fn build_session (
970- early_dcx : EarlyDiagCtxt ,
971970 sopts : config:: Options ,
972971 io : CompilerIO ,
973972 bundle : Option < Lrc < rustc_errors:: FluentBundle > > ,
@@ -992,14 +991,6 @@ pub fn build_session(
992991 let cap_lints_allow = sopts. lint_cap . is_some_and ( |cap| cap == lint:: Allow ) ;
993992 let can_emit_warnings = !( warnings_allow || cap_lints_allow) ;
994993
995- let host_triple = TargetTuple :: from_tuple ( config:: host_tuple ( ) ) ;
996- let ( host, target_warnings) = Target :: search ( & host_triple, & sysroot) . unwrap_or_else ( |e| {
997- early_dcx. early_fatal ( format ! ( "Error loading host specification: {e}" ) )
998- } ) ;
999- for warning in target_warnings. warning_messages ( ) {
1000- early_dcx. early_warn ( warning)
1001- }
1002-
1003994 let fallback_bundle = fallback_fluent_bundle (
1004995 fluent_resources,
1005996 sopts. unstable_opts . translate_directionality_markers ,
@@ -1014,9 +1005,12 @@ pub fn build_session(
10141005 dcx = dcx. with_ice_file ( ice_file) ;
10151006 }
10161007
1017- // Now that the proper handler has been constructed, drop early_dcx to
1018- // prevent accidental use.
1019- drop ( early_dcx) ;
1008+ let host_triple = TargetTuple :: from_tuple ( config:: host_tuple ( ) ) ;
1009+ let ( host, target_warnings) = Target :: search ( & host_triple, & sysroot)
1010+ . unwrap_or_else ( |e| dcx. handle ( ) . fatal ( format ! ( "Error loading host specification: {e}" ) ) ) ;
1011+ for warning in target_warnings. warning_messages ( ) {
1012+ dcx. handle ( ) . warn ( warning)
1013+ }
10201014
10211015 let self_profiler = if let SwitchWithOptPath :: Enabled ( ref d) = sopts. unstable_opts . self_profile
10221016 {
0 commit comments