File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -645,15 +645,17 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
645
645
// an error must be reported.
646
646
let reported_err = tcx. sess . track_errors ( || {
647
647
err. report_as_error ( ecx. tcx ,
648
- "could not evaluate static initializer" ) ;
648
+ "could not evaluate static initializer" )
649
649
} ) ;
650
650
match reported_err {
651
- Ok ( v) => tcx. sess . delay_span_bug ( err. span ,
651
+ Ok ( v) => {
652
+ tcx. sess . delay_span_bug ( err. span ,
652
653
& format ! ( "static eval failure did not emit an error: {:#?}" ,
653
- v) ) ,
654
- Err ( err) => err,
654
+ v) ) ;
655
+ v
656
+ } ,
657
+ Err ( ErrorReported ) => ErrorHandled :: Reported ,
655
658
}
656
- reported_err
657
659
} else if def_id. is_local ( ) {
658
660
// constant defined in this crate, we can figure out a lint level!
659
661
match tcx. describe_def ( def_id) {
You can’t perform that action at this time.
0 commit comments