aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir
diff options
context:
space:
mode:
authorMuhammad Mahad <mahadtxt@gmail.com>2023-08-03 20:46:50 +0500
committerPhilip Herron <philip.herron@embecosm.com>2023-08-10 09:35:08 +0000
commit2da2efa10f3904cfb7e96058dc42681a0cc6191e (patch)
tree9192098c8abd8d6a459909dafb361926e447512b /gcc/rust/hir
parente4da7e5d6be1e9f61d5d93a870c51dd626d0a7e3 (diff)
downloadgcc-2da2efa10f3904cfb7e96058dc42681a0cc6191e.zip
gcc-2da2efa10f3904cfb7e96058dc42681a0cc6191e.tar.gz
gcc-2da2efa10f3904cfb7e96058dc42681a0cc6191e.tar.bz2
gccrs: [E0703] Use of Invalid ABI
Added error code support for invalid ABI. gcc/rust/ChangeLog: * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers): called error function. (ASTLoweringBase::lower_extern_block): likewise. gcc/testsuite/ChangeLog: * rust/compile/abi-options1.rs: updated comment for testcase. Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Diffstat (limited to 'gcc/rust/hir')
-rw-r--r--gcc/rust/hir/rust-ast-lower-base.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index ad8a331..3ddc751 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -702,7 +702,8 @@ ASTLoweringBase::lower_qualifiers (const AST::FunctionQualifiers &qualifiers)
const std::string &extern_abi = qualifiers.get_extern_abi ();
abi = get_abi_from_string (extern_abi);
if (has_extern && abi == ABI::UNKNOWN)
- rust_error_at (qualifiers.get_locus (), "unknown ABI option");
+ rust_error_at (qualifiers.get_locus (), ErrorCode::E0703,
+ "invalid ABI: found %qs", extern_abi.c_str ());
}
return HIR::FunctionQualifiers (qualifiers.get_const_status (), unsafety,
@@ -946,7 +947,8 @@ ASTLoweringBase::lower_extern_block (AST::ExternBlock &extern_block)
const std::string &extern_abi = extern_block.get_abi ();
abi = get_abi_from_string (extern_abi);
if (abi == ABI::UNKNOWN)
- rust_error_at (extern_block.get_locus (), "unknown ABI option");
+ rust_error_at (extern_block.get_locus (), ErrorCode::E0703,
+ "invalid ABI: found %qs", extern_abi.c_str ());
}
HIR::ExternBlock *hir_extern_block