about summary refs log tree commit diff
path: root/tests/ui/proc-macro/attribute.rs
diff options
context:
space:
mode:
authorFolkert de Vries <flokkievids@gmail.com>2025-08-03 10:44:41 +0000
committerGitHub <noreply@github.com>2025-08-03 10:44:41 +0000
commitc691374cc19d583103f3da5d655efb308a1648b9 (patch)
tree767496caef5b54e56f46a834d0d612705ce5e488 /tests/ui/proc-macro/attribute.rs
parentdaa742afe5970109c1e15b391226f78087b10439 (diff)
parent49aa0ecc7b251003e61c38a56471195a2d3dabee (diff)
downloadrust-c691374cc19d583103f3da5d655efb308a1648b9.tar.gz
rust-c691374cc19d583103f3da5d655efb308a1648b9.zip
Merge pull request #1889 from rust-lang/rustc-pull
Rustc pull update
Diffstat (limited to 'tests/ui/proc-macro/attribute.rs')
-rw-r--r--tests/ui/proc-macro/attribute.rs51
1 files changed, 34 insertions, 17 deletions
diff --git a/tests/ui/proc-macro/attribute.rs b/tests/ui/proc-macro/attribute.rs
index 30ed8ff8247..988cdcd0403 100644
--- a/tests/ui/proc-macro/attribute.rs
+++ b/tests/ui/proc-macro/attribute.rs
@@ -6,68 +6,85 @@
 extern crate proc_macro;
 use proc_macro::*;
 
-#[proc_macro_derive] //~ ERROR malformed `proc_macro_derive` attribute
+#[proc_macro_derive]
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE expected this to be a list
 pub fn foo1(input: TokenStream) -> TokenStream { input }
 
-#[proc_macro_derive = ""] //~ ERROR malformed `proc_macro_derive` attribute
+#[proc_macro_derive = ""]
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE expected this to be a list
 pub fn foo2(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d3, a, b)]
-//~^ ERROR attribute must have either one or two arguments
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE the only valid argument here is `attributes`
 pub fn foo3(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d4, attributes(a), b)]
-//~^ ERROR attribute must have either one or two arguments
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE didn't expect any arguments here
 pub fn foo4(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive("a")]
-//~^ ERROR: not a meta item
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE didn't expect a literal here
 pub fn foo5(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d6 = "")]
-//~^ ERROR: must only be one word
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE didn't expect any arguments here
 pub fn foo6(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(m::d7)]
-//~^ ERROR: must only be one word
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE expected a valid identifier here
 pub fn foo7(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d8(a))]
-//~^ ERROR: must only be one word
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE didn't expect any arguments here
 pub fn foo8(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(self)]
-//~^ ERROR: `self` cannot be a name of derive macro
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE expected a valid identifier here
 pub fn foo9(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(PartialEq)] // OK
 pub fn foo10(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d11, a)]
-//~^ ERROR: second argument must be `attributes`
-//~| ERROR: attribute must be of form: `attributes(foo, bar)`
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE the only valid argument here is `attributes`
 pub fn foo11(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d12, attributes)]
-//~^ ERROR: attribute must be of form: `attributes(foo, bar)`
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE expected this to be a list
 pub fn foo12(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d13, attributes("a"))]
-//~^ ERROR: attribute must be a meta item, not a literal
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE expected a valid identifier here
 pub fn foo13(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d14, attributes(a = ""))]
-//~^ ERROR: attribute must only be a single word
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE didn't expect any arguments here
 pub fn foo14(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d15, attributes(m::a))]
-//~^ ERROR: attribute must only be a single word
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE expected a valid identifier here
 pub fn foo15(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d16, attributes(a(b)))]
-//~^ ERROR: attribute must only be a single word
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE didn't expect any arguments here
 pub fn foo16(input: TokenStream) -> TokenStream { input }
 
 #[proc_macro_derive(d17, attributes(self))]
-//~^ ERROR: `self` cannot be a name of derive helper attribute
+//~^ ERROR malformed `proc_macro_derive` attribute
+//~| NOTE expected a valid identifier here
 pub fn foo17(input: TokenStream) -> TokenStream { input }