@@ -430,27 +430,15 @@ fn report_eval_error<'tcx>(
430
430
let ( error, backtrace) = error. into_parts ( ) ;
431
431
backtrace. print_backtrace ( ) ;
432
432
433
- let ( kind, instance) = if ecx. tcx . is_static ( cid. instance . def_id ( ) ) {
434
- ( "static" , String :: new ( ) )
435
- } else {
436
- // If the current item has generics, we'd like to enrich the message with the
437
- // instance and its args: to show the actual compile-time values, in addition to
438
- // the expression, leading to the const eval error.
439
- let instance = & cid. instance ;
440
- if !instance. args . is_empty ( ) {
441
- let instance = with_no_trimmed_paths ! ( instance. to_string( ) ) ;
442
- ( "const_with_path" , instance)
443
- } else {
444
- ( "const" , String :: new ( ) )
445
- }
446
- } ;
433
+ let instance = with_no_trimmed_paths ! ( cid. instance. to_string( ) ) ;
447
434
448
435
super :: report (
449
436
* ecx. tcx ,
450
437
error,
451
438
DUMMY_SP ,
452
439
|| super :: get_span_and_frames ( ecx. tcx , ecx. stack ( ) ) ,
453
440
|diag, span, frames| {
441
+ let num_frames = frames. len ( ) ;
454
442
// FIXME(oli-obk): figure out how to use structured diagnostics again.
455
443
diag. code ( E0080 ) ;
456
444
diag. span_label ( span, crate :: fluent_generated:: const_eval_error) ;
@@ -459,7 +447,7 @@ fn report_eval_error<'tcx>(
459
447
}
460
448
// Add after the frame rendering above, as it adds its own `instance` args.
461
449
diag. arg ( "instance" , instance) ;
462
- diag. arg ( "error_kind " , kind ) ;
450
+ diag. arg ( "num_frames " , num_frames ) ;
463
451
} ,
464
452
)
465
453
}
0 commit comments