diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-07-18 14:38:58 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:55:57 +0100 |
commit | 9a99feab7cbc2dcb01c3af99dca4c2a4403d83b1 (patch) | |
tree | eb4ac0318041e43c2a849fb3d3eb265b30d8473f /gcc | |
parent | 1b1f8d898857b69b98095fc26b4dd95bafffdc18 (diff) | |
download | gcc-9a99feab7cbc2dcb01c3af99dca4c2a4403d83b1.zip gcc-9a99feab7cbc2dcb01c3af99dca4c2a4403d83b1.tar.gz gcc-9a99feab7cbc2dcb01c3af99dca4c2a4403d83b1.tar.bz2 |
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 <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-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 c8451de..3ee7f2b 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); } |