diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-07-18 14:38:58 +0200 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2023-07-20 08:21:00 +0000 |
commit | 61fc7f1cb52db1297943807184e344025aed5afe (patch) | |
tree | 865105912d00ba1b3dddbd10fcfec6a9d08db156 /gcc/rust/util/rust-attributes.cc | |
parent | d6912fb38b96b3989cd009bde1c36e659e0bdd70 (diff) | |
download | gcc-61fc7f1cb52db1297943807184e344025aed5afe.zip gcc-61fc7f1cb52db1297943807184e344025aed5afe.tar.gz gcc-61fc7f1cb52db1297943807184e344025aed5afe.tar.bz2 |
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 <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/util/rust-attributes.cc')
-rw-r--r-- | gcc/rust/util/rust-attributes.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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); } |