From 61fc7f1cb52db1297943807184e344025aed5afe Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Tue, 18 Jul 2023 14:38:58 +0200 Subject: 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 --- gcc/rust/util/rust-attributes.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index 1d2907b..1b2a62d 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); } -- cgit v1.1