about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2025-06-13 12:47:29 -0700
committerJubilee Young <workingjubilee@gmail.com>2025-06-23 09:39:23 -0700
commite93a99b3243e1864bab279476f935d944a2229eb (patch)
tree96f429d1a542d6bf48ee672491baea2eb132e62d
parent2f4a55b41d437e5496a51cf7ba0e7a0b751bc6ad (diff)
downloadrust-e93a99b3243e1864bab279476f935d944a2229eb.tar.gz
rust-e93a99b3243e1864bab279476f935d944a2229eb.zip
hir_analysis: Avoid repeating unsupported ABI errors
-rw-r--r--compiler/rustc_hir_analysis/src/check/check.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index 60b691e0f75..ea570f12721 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -58,15 +58,9 @@ pub fn check_abi(tcx: TyCtxt<'_>, hir_id: hir::HirId, span: Span, abi: ExternAbi
 
     match AbiMap::from_target(&tcx.sess.target).canonize_abi(abi, false) {
         AbiMapping::Direct(..) => (),
+        // already erred in rustc_ast_lowering
         AbiMapping::Invalid => {
-            let mut err = struct_span_code_err!(
-                tcx.dcx(),
-                span,
-                E0570,
-                "`{abi}` is not a supported ABI for the current target",
-            );
-            add_abi_diag_help(abi, &mut err);
-            err.emit();
+            tcx.dcx().span_delayed_bug(span, format!("{abi} should be rejected in ast_lowering"));
         }
         AbiMapping::Deprecated(..) => {
             tcx.node_span_lint(UNSUPPORTED_CALLING_CONVENTIONS, hir_id, span, |lint| {