@@ -345,7 +345,7 @@ fn run_compiler(
345
345
Ok ( None ) => match matches. free. len( ) {
346
346
0 => false , // no input: we will exit early
347
347
1 => panic!( "make_input should have provided valid inputs" ) ,
348
- _ => default_early_dcx. early_error ( format!(
348
+ _ => default_early_dcx. early_fatal ( format!(
349
349
"multiple input filenames provided (first two filenames are `{}` and `{}`)" ,
350
350
matches. free[ 0 ] , matches. free[ 1 ] ,
351
351
) ) ,
@@ -376,7 +376,7 @@ fn run_compiler(
376
376
}
377
377
378
378
if !has_input {
379
- early_dcx. early_error ( "no input filename given" ) ; // this is fatal
379
+ early_dcx. early_fatal ( "no input filename given" ) ; // this is fatal
380
380
}
381
381
382
382
if !sess. opts. unstable_opts. ls. is_empty( ) {
@@ -505,9 +505,8 @@ fn make_input(
505
505
if io:: stdin( ) . read_to_string( & mut src) . is_err( ) {
506
506
// Immediately stop compilation if there was an issue reading
507
507
// the input (for example if the input stream is not UTF-8).
508
- let reported = early_dcx. early_error_no_abort(
509
- "couldn't read from stdin, as it did not contain valid UTF-8" ,
510
- ) ;
508
+ let reported = early_dcx
509
+ . early_err( "couldn't read from stdin, as it did not contain valid UTF-8" ) ;
511
510
return Err ( reported) ;
512
511
}
513
512
if let Ok ( path) = env:: var( "UNSTABLE_RUSTDOC_TEST_PATH" ) {
@@ -567,7 +566,7 @@ fn handle_explain(early_dcx: &EarlyDiagCtxt, registry: Registry, code: &str, col
567
566
}
568
567
}
569
568
Err ( InvalidErrorCode ) => {
570
- early_dcx. early_error ( format!( "{code} is not a valid error code" ) ) ;
569
+ early_dcx. early_fatal ( format!( "{code} is not a valid error code" ) ) ;
571
570
}
572
571
}
573
572
}
@@ -685,7 +684,7 @@ fn list_metadata(early_dcx: &EarlyDiagCtxt, sess: &Session, metadata_loader: &dy
685
684
safe_println!( "{}" , String :: from_utf8( v) . unwrap( ) ) ;
686
685
}
687
686
Input :: Str { .. } => {
688
- early_dcx. early_error ( "cannot list metadata for stdin" ) ;
687
+ early_dcx. early_fatal ( "cannot list metadata for stdin" ) ;
689
688
}
690
689
}
691
690
}
@@ -839,7 +838,7 @@ fn print_crate_info(
839
838
println_info!( "deployment_target={}" , format!( "{major}.{minor}" ) )
840
839
} else {
841
840
early_dcx
842
- . early_error ( "only Apple targets currently support deployment version info" )
841
+ . early_fatal ( "only Apple targets currently support deployment version info" )
843
842
}
844
843
}
845
844
}
@@ -1182,7 +1181,7 @@ pub fn handle_options(early_dcx: &EarlyDiagCtxt, args: &[String]) -> Option<geto
1182
1181
. map( |( flag, _) | format!( "{e}. Did you mean `-{flag} {opt}`?" ) ) ,
1183
1182
_ => None ,
1184
1183
} ;
1185
- early_dcx. early_error ( msg. unwrap_or_else( || e. to_string( ) ) ) ;
1184
+ early_dcx. early_fatal ( msg. unwrap_or_else( || e. to_string( ) ) ) ;
1186
1185
} ) ;
1187
1186
1188
1187
// For all options we just parsed, we check a few aspects:
@@ -1333,7 +1332,7 @@ pub fn install_ice_hook(
1333
1332
{
1334
1333
// the error code is already going to be reported when the panic unwinds up the stack
1335
1334
let early_dcx = EarlyDiagCtxt :: new( ErrorOutputType :: default ( ) ) ;
1336
- let _ = early_dcx. early_error_no_abort ( msg. clone( ) ) ;
1335
+ let _ = early_dcx. early_err ( msg. clone( ) ) ;
1337
1336
return ;
1338
1337
}
1339
1338
} ;
@@ -1481,7 +1480,7 @@ pub fn init_rustc_env_logger(early_dcx: &EarlyDiagCtxt) {
1481
1480
/// the values directly rather than having to set an environment variable.
1482
1481
pub fn init_logger( early_dcx: & EarlyDiagCtxt , cfg: rustc_log:: LoggerConfig ) {
1483
1482
if let Err ( error) = rustc_log:: init_logger( cfg) {
1484
- early_dcx. early_error ( error. to_string( ) ) ;
1483
+ early_dcx. early_fatal ( error. to_string( ) ) ;
1485
1484
}
1486
1485
}
1487
1486
@@ -1500,7 +1499,7 @@ pub fn main() -> ! {
1500
1499
. enumerate( )
1501
1500
. map( |( i, arg) | {
1502
1501
arg. into_string( ) . unwrap_or_else( |arg| {
1503
- early_dcx. early_error ( format!( "argument {i} is not valid Unicode: {arg:?}" ) )
1502
+ early_dcx. early_fatal ( format!( "argument {i} is not valid Unicode: {arg:?}" ) )
1504
1503
} )
1505
1504
} )
1506
1505
. collect:: <Vec <_>>( ) ;
0 commit comments