Skip to content

Commit e93a99b

Browse files
hir_analysis: Avoid repeating unsupported ABI errors
1 parent 2f4a55b commit e93a99b

File tree

1 file changed

+2
-8
lines changed
  • compiler/rustc_hir_analysis/src/check

1 file changed

+2
-8
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,9 @@ pub fn check_abi(tcx: TyCtxt<'_>, hir_id: hir::HirId, span: Span, abi: ExternAbi
5858

5959
match AbiMap::from_target(&tcx.sess.target).canonize_abi(abi, false) {
6060
AbiMapping::Direct(..) => (),
61+
// already erred in rustc_ast_lowering
6162
AbiMapping::Invalid => {
62-
let mut err = struct_span_code_err!(
63-
tcx.dcx(),
64-
span,
65-
E0570,
66-
"`{abi}` is not a supported ABI for the current target",
67-
);
68-
add_abi_diag_help(abi, &mut err);
69-
err.emit();
63+
tcx.dcx().span_delayed_bug(span, format!("{abi} should be rejected in ast_lowering"));
7064
}
7165
AbiMapping::Deprecated(..) => {
7266
tcx.node_span_lint(UNSUPPORTED_CALLING_CONVENTIONS, hir_id, span, |lint| {

0 commit comments

Comments
 (0)