File tree 1 file changed +3
-5
lines changed
compiler/rustc_const_eval/src/const_eval
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -163,18 +163,16 @@ where
163
163
// Report as hard error.
164
164
let ( our_span, frames) = get_span_and_frames ( ) ;
165
165
let span = span. unwrap_or ( our_span) ;
166
- let err = tcx. sess . create_err ( Spanned { span, node : InterpErrorExt ( error) } ) ;
167
166
168
- let Some ( ( mut err, handler) ) = err. into_diagnostic ( ) else {
169
- panic ! ( "did not emit diag" ) ;
170
- } ;
167
+ let handler = & tcx. sess . parse_sess . span_diagnostic ;
168
+ let mut err = handler. create_err ( Spanned { span, node : InterpErrorExt ( error) } ) ;
171
169
172
170
for frame in frames {
173
171
err. eager_subdiagnostic ( handler, frame) ;
174
172
}
175
173
176
174
// Use *our* span to label the interp error
177
- ErrorHandled :: Reported ( handler . emit_diagnostic ( & mut err) . unwrap ( ) . into ( ) )
175
+ ErrorHandled :: Reported ( err. emit ( ) . into ( ) )
178
176
}
179
177
}
180
178
}
You can’t perform that action at this time.
0 commit comments