@@ -278,7 +278,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
278278 // Make sure we have MIR. We check MIR for some stable monomorphic function in libcore.
279279 let sentinel = ecx. try_resolve_path ( & [ "core" , "ascii" , "escape_default" ] , Namespace :: ValueNS ) ;
280280 if !matches ! ( sentinel, Some ( s) if tcx. is_mir_available( s. def. def_id( ) ) ) {
281- tcx. sess . fatal (
281+ tcx. dcx ( ) . fatal (
282282 "the current sysroot was built without `-Zalways-encode-mir`, or libcore seems missing. \
283283 Use `cargo miri setup` to prepare a sysroot that is suitable for Miri."
284284 ) ;
@@ -363,7 +363,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
363363 match entry_type {
364364 EntryFnType :: Main { .. } => {
365365 let start_id = tcx. lang_items ( ) . start_fn ( ) . unwrap_or_else ( || {
366- tcx. sess . fatal (
366+ tcx. dcx ( ) . fatal (
367367 "could not find start function. Make sure the entry point is marked with `#[start]`."
368368 ) ;
369369 } ) ;
@@ -462,8 +462,8 @@ pub fn eval_entry<'tcx>(
462462 if leak_check && !ignore_leaks {
463463 // Check for thread leaks.
464464 if !ecx. have_all_terminated ( ) {
465- tcx. sess . err ( "the main thread terminated without waiting for all remaining threads" ) ;
466- tcx. sess . note ( "pass `-Zmiri-ignore-leaks` to disable this check" ) ;
465+ tcx. dcx ( ) . err ( "the main thread terminated without waiting for all remaining threads" ) ;
466+ tcx. dcx ( ) . note ( "pass `-Zmiri-ignore-leaks` to disable this check" ) ;
467467 return None ;
468468 }
469469 // Check for memory leaks.
@@ -474,10 +474,10 @@ pub fn eval_entry<'tcx>(
474474 let leak_message = "the evaluated program leaked memory, pass `-Zmiri-ignore-leaks` to disable this check" ;
475475 if ecx. machine . collect_leak_backtraces {
476476 // If we are collecting leak backtraces, each leak is a distinct error diagnostic.
477- tcx. sess . note ( leak_message) ;
477+ tcx. dcx ( ) . note ( leak_message) ;
478478 } else {
479479 // If we do not have backtraces, we just report an error without any span.
480- tcx. sess . err ( leak_message) ;
480+ tcx. dcx ( ) . err ( leak_message) ;
481481 } ;
482482 // Ignore the provided return code - let the reported error
483483 // determine the return code.
0 commit comments