File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -641,19 +641,17 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
641641 let err = error_to_const_error ( & ecx, error) ;
642642 // errors in statics are always emitted as fatal errors
643643 if tcx. is_static ( def_id) . is_some ( ) {
644- let reported_err = err. report_as_error ( ecx. tcx ,
645- "could not evaluate static initializer" ) ;
646644 // Ensure that if the above error was either `TooGeneric` or `Reported`
647645 // an error must be reported.
648- let tracked_err = tcx. sess . track_errors ( || {
646+ let reported_err = tcx. sess . track_errors ( || {
649647 err. report_as_error ( ecx. tcx ,
650648 "could not evaluate static initializer" ) ;
651649 } ) ;
652- match tracked_err {
653- Ok ( reported_err ) => tcx. sess . delay_span_bug ( err. span ,
650+ match reported_err {
651+ Ok ( v ) => tcx. sess . delay_span_bug ( err. span ,
654652 & format ! ( "static eval failure did not emit an error: {:#?}" ,
655- reported_err ) ) ,
656- Err ( _ ) => ( ) ,
653+ v ) ) ,
654+ Err ( err ) => err ,
657655 }
658656 reported_err
659657 } else if def_id. is_local ( ) {
You can’t perform that action at this time.
0 commit comments