The inline attribute only supports two arguments:
- always
- never
All other arguments given to the inline attribute will
return error.
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 message.
Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
}
else
{
- rust_error_at (attr.get_locus (), "unknown inline option");
+ rich_location rich_locus (line_table, attr.get_locus ());
+ rich_locus.add_fixit_replace ("unknown inline option");
+ rust_error_at (rich_locus, ErrorCode::E0535,
+ "invalid argument, %<inline%> attribute only accepts "
+ "%<always%> or %<never%>");
}
}
// { dg-additional-options "-w" }
-#[inline(A)] // { dg-error "unknown inline option" }
+#[inline(A)] // { dg-error "invalid argument, .inline. attribute only accepts .always. or .never." }
fn test_a() {}
#[inline(A, B)] // { dg-error "invalid number of arguments" }