@@ -965,7 +965,6 @@ fn default_emitter(
965
965
#[ allow( rustc:: bad_opt_access) ]
966
966
#[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
967
967
pub fn build_session (
968
- early_dcx : EarlyDiagCtxt ,
969
968
sopts : config:: Options ,
970
969
io : CompilerIO ,
971
970
bundle : Option < Arc < rustc_errors:: FluentBundle > > ,
@@ -990,14 +989,6 @@ pub fn build_session(
990
989
let cap_lints_allow = sopts. lint_cap . is_some_and ( |cap| cap == lint:: Allow ) ;
991
990
let can_emit_warnings = !( warnings_allow || cap_lints_allow) ;
992
991
993
- let host_triple = TargetTuple :: from_tuple ( config:: host_tuple ( ) ) ;
994
- let ( host, target_warnings) = Target :: search ( & host_triple, & sysroot) . unwrap_or_else ( |e| {
995
- early_dcx. early_fatal ( format ! ( "Error loading host specification: {e}" ) )
996
- } ) ;
997
- for warning in target_warnings. warning_messages ( ) {
998
- early_dcx. early_warn ( warning)
999
- }
1000
-
1001
992
let fallback_bundle = fallback_fluent_bundle (
1002
993
fluent_resources,
1003
994
sopts. unstable_opts . translate_directionality_markers ,
@@ -1012,9 +1003,12 @@ pub fn build_session(
1012
1003
dcx = dcx. with_ice_file ( ice_file) ;
1013
1004
}
1014
1005
1015
- // Now that the proper handler has been constructed, drop early_dcx to
1016
- // prevent accidental use.
1017
- drop ( early_dcx) ;
1006
+ let host_triple = TargetTuple :: from_tuple ( config:: host_tuple ( ) ) ;
1007
+ let ( host, target_warnings) = Target :: search ( & host_triple, & sysroot)
1008
+ . unwrap_or_else ( |e| dcx. handle ( ) . fatal ( format ! ( "Error loading host specification: {e}" ) ) ) ;
1009
+ for warning in target_warnings. warning_messages ( ) {
1010
+ dcx. handle ( ) . warn ( warning)
1011
+ }
1018
1012
1019
1013
let self_profiler = if let SwitchWithOptPath :: Enabled ( ref d) = sopts. unstable_opts . self_profile
1020
1014
{
0 commit comments