File tree 1 file changed +5
-7
lines changed
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>(
641
641
let err = error_to_const_error ( & ecx, error) ;
642
642
// errors in statics are always emitted as fatal errors
643
643
if tcx. is_static ( def_id) . is_some ( ) {
644
- let reported_err = err. report_as_error ( ecx. tcx ,
645
- "could not evaluate static initializer" ) ;
646
644
// Ensure that if the above error was either `TooGeneric` or `Reported`
647
645
// an error must be reported.
648
- let tracked_err = tcx. sess . track_errors ( || {
646
+ let reported_err = tcx. sess . track_errors ( || {
649
647
err. report_as_error ( ecx. tcx ,
650
648
"could not evaluate static initializer" ) ;
651
649
} ) ;
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 ,
654
652
& format ! ( "static eval failure did not emit an error: {:#?}" ,
655
- reported_err ) ) ,
656
- Err ( _ ) => ( ) ,
653
+ v ) ) ,
654
+ Err ( err ) => err ,
657
655
}
658
656
reported_err
659
657
} else if def_id. is_local ( ) {
You can’t perform that action at this time.
0 commit comments