@@ -967,7 +967,6 @@ fn default_emitter(
967
967
#[ allow( rustc:: bad_opt_access) ]
968
968
#[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
969
969
pub fn build_session (
970
- early_dcx : EarlyDiagCtxt ,
971
970
sopts : config:: Options ,
972
971
io : CompilerIO ,
973
972
bundle : Option < Lrc < rustc_errors:: FluentBundle > > ,
@@ -992,14 +991,6 @@ pub fn build_session(
992
991
let cap_lints_allow = sopts. lint_cap . is_some_and ( |cap| cap == lint:: Allow ) ;
993
992
let can_emit_warnings = !( warnings_allow || cap_lints_allow) ;
994
993
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
-
1003
994
let fallback_bundle = fallback_fluent_bundle (
1004
995
fluent_resources,
1005
996
sopts. unstable_opts . translate_directionality_markers ,
@@ -1014,9 +1005,12 @@ pub fn build_session(
1014
1005
dcx = dcx. with_ice_file ( ice_file) ;
1015
1006
}
1016
1007
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
+ }
1020
1014
1021
1015
let self_profiler = if let SwitchWithOptPath :: Enabled ( ref d) = sopts. unstable_opts . self_profile
1022
1016
{
0 commit comments