Skip to content

Commit 004c45e

Browse files
committed
remove span_delayed_bug
1 parent 2ebd177 commit 004c45e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

compiler/rustc_hir_analysis/src/check/compare_eii.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,15 +425,11 @@ fn extract_spans_for_error_reporting<'tcx>(
425425
(sig.decl.inputs.iter().map(|t| t.span).chain(iter::once(sig.decl.output.span())), ident)
426426
};
427427

428-
let declaration_args = declaration.as_local().and_then(|def_id| {
428+
let declaration_args = declaration.as_local().map(|def_id| {
429429
if let Some(sig) = get_declaration_sig(tcx, def_id) {
430-
Some(sig.decl.inputs.iter().map(|t| t.span).chain(iter::once(sig.decl.output.span())))
430+
sig.decl.inputs.iter().map(|t| t.span).chain(iter::once(sig.decl.output.span()))
431431
} else {
432-
tcx.dcx().span_delayed_bug(
433-
tcx.def_span(def_id),
434-
format!("expected {def_id:?} to be a foreign function"),
435-
);
436-
None
432+
panic!("expected {def_id:?} to be a foreign function");
437433
}
438434
});
439435

0 commit comments

Comments
 (0)