@@ -278,7 +278,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
278
278
// Make sure we have MIR. We check MIR for some stable monomorphic function in libcore.
279
279
let sentinel = ecx. try_resolve_path ( & [ "core" , "ascii" , "escape_default" ] , Namespace :: ValueNS ) ;
280
280
if !matches ! ( sentinel, Some ( s) if tcx. is_mir_available( s. def. def_id( ) ) ) {
281
- tcx. sess . fatal (
281
+ tcx. dcx ( ) . fatal (
282
282
"the current sysroot was built without `-Zalways-encode-mir`, or libcore seems missing. \
283
283
Use `cargo miri setup` to prepare a sysroot that is suitable for Miri."
284
284
) ;
@@ -363,7 +363,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
363
363
match entry_type {
364
364
EntryFnType :: Main { .. } => {
365
365
let start_id = tcx. lang_items ( ) . start_fn ( ) . unwrap_or_else ( || {
366
- tcx. sess . fatal (
366
+ tcx. dcx ( ) . fatal (
367
367
"could not find start function. Make sure the entry point is marked with `#[start]`."
368
368
) ;
369
369
} ) ;
@@ -462,8 +462,8 @@ pub fn eval_entry<'tcx>(
462
462
if leak_check && !ignore_leaks {
463
463
// Check for thread leaks.
464
464
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" ) ;
467
467
return None ;
468
468
}
469
469
// Check for memory leaks.
@@ -474,10 +474,10 @@ pub fn eval_entry<'tcx>(
474
474
let leak_message = "the evaluated program leaked memory, pass `-Zmiri-ignore-leaks` to disable this check" ;
475
475
if ecx. machine . collect_leak_backtraces {
476
476
// 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) ;
478
478
} else {
479
479
// 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) ;
481
481
} ;
482
482
// Ignore the provided return code - let the reported error
483
483
// determine the return code.
0 commit comments