Inline attribute takes one argument, but
more than one argument was found.
gcc/rust/ChangeLog:
* backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
Added rich_location & error code.
gcc/testsuite/ChangeLog:
* rust/compile/inline_2.rs: Added new case.
Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
AST::AttrInputMetaItemContainer *meta_item = option.parse_to_meta_item ();
if (meta_item->get_items ().size () != 1)
{
- rust_error_at (attr.get_locus (), "invalid number of arguments");
+ rich_location rich_locus (line_table, attr.get_locus ());
+ rich_locus.add_fixit_replace ("expected one argument");
+ rust_error_at (rich_locus, ErrorCode::E0534,
+ "invalid number of arguments");
return;
}
#[inline(A, B)] // { dg-error "invalid number of arguments" }
fn test_b() {}
+
+#[inline()] // { dg-error "invalid number of arguments" }
+fn test_c() {}
\ No newline at end of file