aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorjjasmine <tanghocle456@gmail.com>2024-05-31 19:34:49 -0700
committerCohenArthur <arthur.cohen@embecosm.com>2024-06-13 15:31:07 +0000
commit379670e7f685de8b4e8cb38e8dcc35b886e55a02 (patch)
tree4727f5889e6d63eb67dde36e4556566d91b9160e /gcc/rust
parent914777653e9433c525e4b584aa0d5658c7eccddc (diff)
downloadgcc-379670e7f685de8b4e8cb38e8dcc35b886e55a02.zip
gcc-379670e7f685de8b4e8cb38e8dcc35b886e55a02.tar.gz
gcc-379670e7f685de8b4e8cb38e8dcc35b886e55a02.tar.bz2
Fix warnings
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Fix compile warnings. (parse_options): Likewise. (parse_asm): Likewise. gcc/testsuite/ChangeLog: * rust/compile/inline_asm_illegal_options.rs:
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/expand/rust-macro-builtins-asm.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/rust-macro-builtins-asm.cc
index fd7da8c..b979b34 100644
--- a/gcc/rust/expand/rust-macro-builtins-asm.cc
+++ b/gcc/rust/expand/rust-macro-builtins-asm.cc
@@ -219,7 +219,6 @@ parse_reg_operand (Parser<MacroInvocLexer> &parser, TokenId last_token_id,
token = parser.peek_current_token ();
- bool is_explicit_reg = false;
bool is_global_asm = inline_asm.is_global_asm;
if (!is_global_asm && check_identifier (parser, "in"))
{
@@ -354,7 +353,12 @@ parse_options (Parser<MacroInvocLexer> &parser, TokenId last_token_id,
{
// TODO: Unexpected error, please return the correct error
rust_error_at (token->get_locus (),
- "Unexpected token encountered in parse_options");
+ "expected one of %qs, %qs, %qs, %qs, %qs, %qs, %qs, "
+ "%qs, %qs, or %qs, found %qs",
+ ")", "att_syntax", "may_unwind", "nomem", "noreturn",
+ "nostack", "preserves_flags", "pure", "raw",
+ "readonly", token->as_string ().c_str ());
+ return -1;
}
if (parser.skip_token (RIGHT_PAREN))
{
@@ -519,7 +523,7 @@ parse_asm (location_t invoc_locus, AST::MacroInvocData &invoc,
if (fm_string == tl::nullopt)
{
rust_error_at (parser.peek_current_token ()->get_locus (),
- "asm template must be a string literal");
+ "%s template must be a string literal", "asm");
return tl::nullopt;
}