From: Pierre-Emmanuel Patry Date: Tue, 18 Jul 2023 12:38:58 +0000 (+0200) Subject: gccrs: proc macro: Add help message to malformed derive X-Git-Tag: basepoints/gcc-15~2332 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a99feab7cbc2dcb01c3af99dca4c2a4403d83b1;p=thirdparty%2Fgcc.git gccrs: proc macro: Add help message to malformed derive Add an help message in case of malformed proc_macro_derive declaration. gcc/rust/ChangeLog: * util/rust-attributes.cc (AttributeChecker::visit): Add help message. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index c8451def94eb..3ee7f2b6f0c5 100644 --- a/gcc/rust/util/rust-attributes.cc +++ b/gcc/rust/util/rust-attributes.cc @@ -565,6 +565,10 @@ AttributeChecker::visit (AST::Function &fun) { rust_error_at (attribute.get_locus (), "malformed %<%s%> attribute input", name); + rust_inform ( + attribute.get_locus (), + "must be of the form: %<#[proc_macro_derive(TraitName, " + "/*opt*/ attributes(name1, name2, ...))]%>"); } check_crate_type (name, attribute); }