Update test results
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This commit is contained in:
parent
ec637000c6
commit
fea7809edb
11 changed files with 278 additions and 166 deletions
|
|
@ -43,12 +43,6 @@ error: malformed `no_sanitize` attribute input
|
|||
LL | #[no_sanitize]
|
||||
| ^^^^^^^^^^^^^^ help: must be of the form: `#[no_sanitize(address, kcfi, memory, thread)]`
|
||||
|
||||
error: malformed `proc_macro` attribute input
|
||||
--> $DIR/malformed-attrs.rs:100:1
|
||||
|
|
||||
LL | #[proc_macro = 18]
|
||||
| ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]`
|
||||
|
||||
error: malformed `instruction_set` attribute input
|
||||
--> $DIR/malformed-attrs.rs:107:1
|
||||
|
|
||||
|
|
@ -67,18 +61,6 @@ error: malformed `coroutine` attribute input
|
|||
LL | #[coroutine = 63] || {}
|
||||
| ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[coroutine]`
|
||||
|
||||
error: malformed `proc_macro_attribute` attribute input
|
||||
--> $DIR/malformed-attrs.rs:117:1
|
||||
|
|
||||
LL | #[proc_macro_attribute = 19]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]`
|
||||
|
||||
error: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/malformed-attrs.rs:124:1
|
||||
|
|
||||
LL | #[proc_macro_derive]
|
||||
| ^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: malformed `must_not_suspend` attribute input
|
||||
--> $DIR/malformed-attrs.rs:133:1
|
||||
|
|
||||
|
|
@ -454,6 +436,24 @@ LL | #[no_implicit_prelude = 23]
|
|||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[no_implicit_prelude]`
|
||||
|
||||
error[E0565]: malformed `proc_macro` attribute input
|
||||
--> $DIR/malformed-attrs.rs:100:1
|
||||
|
|
||||
LL | #[proc_macro = 18]
|
||||
| ^^^^^^^^^^^^^----^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro]`
|
||||
|
||||
error[E0565]: malformed `proc_macro_attribute` attribute input
|
||||
--> $DIR/malformed-attrs.rs:117:1
|
||||
|
|
||||
LL | #[proc_macro_attribute = 19]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^----^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_attribute]`
|
||||
|
||||
error[E0539]: malformed `must_use` attribute input
|
||||
--> $DIR/malformed-attrs.rs:120:1
|
||||
|
|
||||
|
|
@ -471,6 +471,15 @@ LL - #[must_use = 1]
|
|||
LL + #[must_use]
|
||||
|
|
||||
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/malformed-attrs.rs:124:1
|
||||
|
|
||||
LL | #[proc_macro_derive]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| expected this to be a list
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input
|
||||
--> $DIR/malformed-attrs.rs:129:1
|
||||
|
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ pub fn b() {}
|
|||
#[proc_macro_derive(unsafe(Foo))]
|
||||
//~^ ERROR attribute is only usable with crates of the `proc-macro` crate type
|
||||
//~| ERROR: expected identifier, found keyword `unsafe`
|
||||
//~| ERROR malformed `proc_macro_derive` attribute input
|
||||
pub fn c() {}
|
||||
|
||||
#[unsafe(proc_macro_attribute)]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
error[E0452]: malformed lint attribute input
|
||||
--> $DIR/proc-unsafe-attributes.rs:26:16
|
||||
--> $DIR/proc-unsafe-attributes.rs:27:16
|
||||
|
|
||||
LL | #[unsafe(allow(unsafe(dead_code)))]
|
||||
| ^^^^^^^^^^^^^^^^^ bad attribute argument
|
||||
|
||||
error[E0452]: malformed lint attribute input
|
||||
--> $DIR/proc-unsafe-attributes.rs:26:16
|
||||
--> $DIR/proc-unsafe-attributes.rs:27:16
|
||||
|
|
||||
LL | #[unsafe(allow(unsafe(dead_code)))]
|
||||
| ^^^^^^^^^^^^^^^^^ bad attribute argument
|
||||
|
|
@ -40,7 +40,7 @@ LL | #[proc_macro_derive(r#unsafe(Foo))]
|
|||
| ++
|
||||
|
||||
error: `proc_macro_attribute` is not an unsafe attribute
|
||||
--> $DIR/proc-unsafe-attributes.rs:17:3
|
||||
--> $DIR/proc-unsafe-attributes.rs:18:3
|
||||
|
|
||||
LL | #[unsafe(proc_macro_attribute)]
|
||||
| ^^^^^^ this is not an unsafe attribute
|
||||
|
|
@ -48,7 +48,7 @@ LL | #[unsafe(proc_macro_attribute)]
|
|||
= note: extraneous unsafe is not allowed in attributes
|
||||
|
||||
error: `allow` is not an unsafe attribute
|
||||
--> $DIR/proc-unsafe-attributes.rs:22:3
|
||||
--> $DIR/proc-unsafe-attributes.rs:23:3
|
||||
|
|
||||
LL | #[unsafe(allow(dead_code))]
|
||||
| ^^^^^^ this is not an unsafe attribute
|
||||
|
|
@ -56,7 +56,7 @@ LL | #[unsafe(allow(dead_code))]
|
|||
= note: extraneous unsafe is not allowed in attributes
|
||||
|
||||
error: `allow` is not an unsafe attribute
|
||||
--> $DIR/proc-unsafe-attributes.rs:26:3
|
||||
--> $DIR/proc-unsafe-attributes.rs:27:3
|
||||
|
|
||||
LL | #[unsafe(allow(unsafe(dead_code)))]
|
||||
| ^^^^^^ this is not an unsafe attribute
|
||||
|
|
@ -64,7 +64,7 @@ LL | #[unsafe(allow(unsafe(dead_code)))]
|
|||
= note: extraneous unsafe is not allowed in attributes
|
||||
|
||||
error: expected identifier, found keyword `unsafe`
|
||||
--> $DIR/proc-unsafe-attributes.rs:26:16
|
||||
--> $DIR/proc-unsafe-attributes.rs:27:16
|
||||
|
|
||||
LL | #[unsafe(allow(unsafe(dead_code)))]
|
||||
| ^^^^^^ expected identifier, found keyword
|
||||
|
|
@ -93,13 +93,13 @@ LL | #[proc_macro_derive(unsafe(Foo))]
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type
|
||||
--> $DIR/proc-unsafe-attributes.rs:17:1
|
||||
--> $DIR/proc-unsafe-attributes.rs:18:1
|
||||
|
|
||||
LL | #[unsafe(proc_macro_attribute)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0452]: malformed lint attribute input
|
||||
--> $DIR/proc-unsafe-attributes.rs:26:16
|
||||
--> $DIR/proc-unsafe-attributes.rs:27:16
|
||||
|
|
||||
LL | #[unsafe(allow(unsafe(dead_code)))]
|
||||
| ^^^^^^^^^^^^^^^^^ bad attribute argument
|
||||
|
|
@ -107,7 +107,24 @@ LL | #[unsafe(allow(unsafe(dead_code)))]
|
|||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0452]: malformed lint attribute input
|
||||
--> $DIR/proc-unsafe-attributes.rs:26:16
|
||||
--> $DIR/proc-unsafe-attributes.rs:27:16
|
||||
|
|
||||
LL | #[unsafe(allow(unsafe(dead_code)))]
|
||||
| ^^^^^^^^^^^^^^^^^ bad attribute argument
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0565]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/proc-unsafe-attributes.rs:12:1
|
||||
|
|
||||
LL | #[proc_macro_derive(unsafe(Foo))]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^-----^^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error[E0452]: malformed lint attribute input
|
||||
--> $DIR/proc-unsafe-attributes.rs:27:16
|
||||
|
|
||||
LL | #[unsafe(allow(unsafe(dead_code)))]
|
||||
| ^^^^^^^^^^^^^^^^^ bad attribute argument
|
||||
|
|
@ -115,21 +132,14 @@ LL | #[unsafe(allow(unsafe(dead_code)))]
|
|||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0452]: malformed lint attribute input
|
||||
--> $DIR/proc-unsafe-attributes.rs:26:16
|
||||
--> $DIR/proc-unsafe-attributes.rs:27:16
|
||||
|
|
||||
LL | #[unsafe(allow(unsafe(dead_code)))]
|
||||
| ^^^^^^^^^^^^^^^^^ bad attribute argument
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0452]: malformed lint attribute input
|
||||
--> $DIR/proc-unsafe-attributes.rs:26:16
|
||||
|
|
||||
LL | #[unsafe(allow(unsafe(dead_code)))]
|
||||
| ^^^^^^^^^^^^^^^^^ bad attribute argument
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
error: aborting due to 18 previous errors
|
||||
|
||||
error: aborting due to 17 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0452`.
|
||||
Some errors have detailed explanations: E0452, E0565.
|
||||
For more information about an error, try `rustc --explain E0452`.
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
// see gated-link-args.rs
|
||||
// see issue-43106-gating-of-macro_escape.rs for crate-level; but non crate-level is below at "2700"
|
||||
// (cannot easily test gating of crate-level #[no_std]; but non crate-level is below at "2600")
|
||||
#![proc_macro_derive()] //~ WARN `#[proc_macro_derive]` only has an effect
|
||||
#![proc_macro_derive(Test)] //~ WARN `#[proc_macro_derive]` only has an effect
|
||||
#![doc = "2400"]
|
||||
#![cold] //~ WARN attribute should be applied to a function
|
||||
//~^ WARN this was previously accepted
|
||||
|
|
|
|||
|
|
@ -367,12 +367,6 @@ warning: `#[should_panic]` only has an effect on functions
|
|||
LL | #![should_panic]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: `#[proc_macro_derive]` only has an effect on functions
|
||||
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1
|
||||
|
|
||||
LL | #![proc_macro_derive()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: attribute should be applied to an `extern` block with non-Rust ABI
|
||||
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:64:1
|
||||
|
|
||||
|
|
@ -409,6 +403,12 @@ warning: `#[must_use]` has no effect when applied to a module
|
|||
LL | #![must_use]
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
warning: `#[proc_macro_derive]` only has an effect on functions
|
||||
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1
|
||||
|
|
||||
LL | #![proc_macro_derive(Test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: attribute should be applied to a function definition
|
||||
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1
|
||||
|
|
||||
|
|
|
|||
|
|
@ -7,27 +7,27 @@
|
|||
// signal errors, making it incompatible with the "warnings only"
|
||||
// nature of issue-43106-gating-of-builtin-attrs.rs
|
||||
|
||||
#[proc_macro_derive()]
|
||||
#[proc_macro_derive(Test)]
|
||||
//~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
mod proc_macro_derive1 {
|
||||
mod inner { #![proc_macro_derive()] }
|
||||
mod inner { #![proc_macro_derive(Test)] }
|
||||
// (no error issued here if there was one on outer module)
|
||||
}
|
||||
|
||||
mod proc_macro_derive2 {
|
||||
mod inner { #![proc_macro_derive()] }
|
||||
mod inner { #![proc_macro_derive(Test)] }
|
||||
//~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
|
||||
#[proc_macro_derive()] fn f() { }
|
||||
#[proc_macro_derive(Test)] fn f() { }
|
||||
//~^ ERROR the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro`
|
||||
|
||||
#[proc_macro_derive()] struct S;
|
||||
#[proc_macro_derive(Test)] struct S;
|
||||
//~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
|
||||
#[proc_macro_derive()] type T = S;
|
||||
#[proc_macro_derive(Test)] type T = S;
|
||||
//~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
|
||||
#[proc_macro_derive()] impl S { }
|
||||
#[proc_macro_derive(Test)] impl S { }
|
||||
//~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
error: the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
--> $DIR/issue-43106-gating-of-proc_macro_derive.rs:10:1
|
||||
|
|
||||
LL | #[proc_macro_derive()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | #[proc_macro_derive(Test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
--> $DIR/issue-43106-gating-of-proc_macro_derive.rs:18:17
|
||||
|
|
||||
LL | mod inner { #![proc_macro_derive()] }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | mod inner { #![proc_macro_derive(Test)] }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
|
||||
--> $DIR/issue-43106-gating-of-proc_macro_derive.rs:21:5
|
||||
|
|
||||
LL | #[proc_macro_derive()] fn f() { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | #[proc_macro_derive(Test)] fn f() { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
--> $DIR/issue-43106-gating-of-proc_macro_derive.rs:24:5
|
||||
|
|
||||
LL | #[proc_macro_derive()] struct S;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | #[proc_macro_derive(Test)] struct S;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
--> $DIR/issue-43106-gating-of-proc_macro_derive.rs:27:5
|
||||
|
|
||||
LL | #[proc_macro_derive()] type T = S;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | #[proc_macro_derive(Test)] type T = S;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[proc_macro_derive]` attribute may only be used on bare functions
|
||||
--> $DIR/issue-43106-gating-of-proc_macro_derive.rs:30:5
|
||||
|
|
||||
LL | #[proc_macro_derive()] impl S { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | #[proc_macro_derive(Test)] impl S { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -1,104 +1,148 @@
|
|||
error: malformed `proc_macro_derive` attribute input
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:9:1
|
||||
|
|
||||
LL | #[proc_macro_derive]
|
||||
| ^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| expected this to be a list
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:12:1
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:14:1
|
||||
|
|
||||
LL | #[proc_macro_derive = ""]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| expected this to be a list
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: attribute must have either one or two arguments
|
||||
--> $DIR/attribute.rs:15:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d3, a, b)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: attribute must have either one or two arguments
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:19:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d4, attributes(a), b)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | #[proc_macro_derive(d3, a, b)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^-^^^^^
|
||||
| | |
|
||||
| | the only valid argument here is `attributes`
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: not a meta item
|
||||
--> $DIR/attribute.rs:23:21
|
||||
error[E0565]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:24:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d4, attributes(a), b)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error[E0565]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:29:1
|
||||
|
|
||||
LL | #[proc_macro_derive("a")]
|
||||
| ^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^---^^
|
||||
| | |
|
||||
| | didn't expect a literal here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: must only be one word
|
||||
--> $DIR/attribute.rs:27:21
|
||||
error[E0565]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:34:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d6 = "")]
|
||||
| ^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^----^^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: must only be one word
|
||||
--> $DIR/attribute.rs:31:21
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:39:1
|
||||
|
|
||||
LL | #[proc_macro_derive(m::d7)]
|
||||
| ^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^-----^^
|
||||
| | |
|
||||
| | expected a valid identifier here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: must only be one word
|
||||
--> $DIR/attribute.rs:35:21
|
||||
error[E0565]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:44:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d8(a))]
|
||||
| ^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^---^^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: `self` cannot be a name of derive macro
|
||||
--> $DIR/attribute.rs:39:21
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:49:1
|
||||
|
|
||||
LL | #[proc_macro_derive(self)]
|
||||
| ^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^----^^
|
||||
| | |
|
||||
| | expected a valid identifier here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: second argument must be `attributes`
|
||||
--> $DIR/attribute.rs:46:26
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:57:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d11, a)]
|
||||
| ^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^-^^
|
||||
| | |
|
||||
| | the only valid argument here is `attributes`
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: attribute must be of form: `attributes(foo, bar)`
|
||||
--> $DIR/attribute.rs:46:26
|
||||
|
|
||||
LL | #[proc_macro_derive(d11, a)]
|
||||
| ^
|
||||
|
||||
error: attribute must be of form: `attributes(foo, bar)`
|
||||
--> $DIR/attribute.rs:51:26
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:62:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d12, attributes)]
|
||||
| ^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^----------^^
|
||||
| | |
|
||||
| | expected this to be a list
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: attribute must be a meta item, not a literal
|
||||
--> $DIR/attribute.rs:55:37
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:67:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d13, attributes("a"))]
|
||||
| ^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^
|
||||
| | |
|
||||
| | expected a valid identifier here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: attribute must only be a single word
|
||||
--> $DIR/attribute.rs:59:37
|
||||
error[E0565]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:72:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d14, attributes(a = ""))]
|
||||
| ^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: attribute must only be a single word
|
||||
--> $DIR/attribute.rs:63:37
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:77:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d15, attributes(m::a))]
|
||||
| ^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^
|
||||
| | |
|
||||
| | expected a valid identifier here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: attribute must only be a single word
|
||||
--> $DIR/attribute.rs:67:37
|
||||
error[E0565]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:82:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d16, attributes(a(b)))]
|
||||
| ^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: `self` cannot be a name of derive helper attribute
|
||||
--> $DIR/attribute.rs:71:37
|
||||
error[E0539]: malformed `proc_macro_derive` attribute input
|
||||
--> $DIR/attribute.rs:87:1
|
||||
|
|
||||
LL | #[proc_macro_derive(d17, attributes(self))]
|
||||
| ^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^
|
||||
| | |
|
||||
| | expected a valid identifier here
|
||||
| help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]`
|
||||
|
||||
error: aborting due to 17 previous errors
|
||||
error: aborting due to 16 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0539, E0565.
|
||||
For more information about an error, try `rustc --explain E0539`.
|
||||
|
|
|
|||
|
|
@ -7,20 +7,32 @@ extern crate proc_macro;
|
|||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
#[proc_macro = "test"] //~ ERROR malformed `proc_macro` attribute
|
||||
#[proc_macro = "test"]
|
||||
//~^ ERROR malformed `proc_macro` attribute
|
||||
//~| NOTE didn't expect any arguments here
|
||||
pub fn a(a: TokenStream) -> TokenStream { a }
|
||||
|
||||
#[proc_macro()] //~ ERROR malformed `proc_macro` attribute
|
||||
#[proc_macro()]
|
||||
//~^ ERROR malformed `proc_macro` attribute
|
||||
//~| NOTE didn't expect any arguments here
|
||||
pub fn c(a: TokenStream) -> TokenStream { a }
|
||||
|
||||
#[proc_macro(x)] //~ ERROR malformed `proc_macro` attribute
|
||||
#[proc_macro(x)]
|
||||
//~^ ERROR malformed `proc_macro` attribute
|
||||
//~| NOTE didn't expect any arguments here
|
||||
pub fn d(a: TokenStream) -> TokenStream { a }
|
||||
|
||||
#[proc_macro_attribute = "test"] //~ ERROR malformed `proc_macro_attribute` attribute
|
||||
#[proc_macro_attribute = "test"]
|
||||
//~^ ERROR malformed `proc_macro_attribute` attribute
|
||||
//~| NOTE didn't expect any arguments here
|
||||
pub fn e(_: TokenStream, a: TokenStream) -> TokenStream { a }
|
||||
|
||||
#[proc_macro_attribute()] //~ ERROR malformed `proc_macro_attribute` attribute
|
||||
#[proc_macro_attribute()]
|
||||
//~^ ERROR malformed `proc_macro_attribute` attribute
|
||||
//~| NOTE didn't expect any arguments here
|
||||
pub fn g(_: TokenStream, a: TokenStream) -> TokenStream { a }
|
||||
|
||||
#[proc_macro_attribute(x)] //~ ERROR malformed `proc_macro_attribute` attribute
|
||||
#[proc_macro_attribute(x)]
|
||||
//~^ ERROR malformed `proc_macro_attribute` attribute
|
||||
//~| NOTE didn't expect any arguments here
|
||||
pub fn h(_: TokenStream, a: TokenStream) -> TokenStream { a }
|
||||
|
|
|
|||
|
|
@ -1,38 +1,57 @@
|
|||
error: malformed `proc_macro` attribute input
|
||||
error[E0565]: malformed `proc_macro` attribute input
|
||||
--> $DIR/invalid-attributes.rs:10:1
|
||||
|
|
||||
LL | #[proc_macro = "test"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]`
|
||||
| ^^^^^^^^^^^^^--------^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro]`
|
||||
|
||||
error: malformed `proc_macro` attribute input
|
||||
--> $DIR/invalid-attributes.rs:13:1
|
||||
error[E0565]: malformed `proc_macro` attribute input
|
||||
--> $DIR/invalid-attributes.rs:15:1
|
||||
|
|
||||
LL | #[proc_macro()]
|
||||
| ^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]`
|
||||
| ^^^^^^^^^^^^--^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro]`
|
||||
|
||||
error: malformed `proc_macro` attribute input
|
||||
--> $DIR/invalid-attributes.rs:16:1
|
||||
error[E0565]: malformed `proc_macro` attribute input
|
||||
--> $DIR/invalid-attributes.rs:20:1
|
||||
|
|
||||
LL | #[proc_macro(x)]
|
||||
| ^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]`
|
||||
| ^^^^^^^^^^^^---^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro]`
|
||||
|
||||
error: malformed `proc_macro_attribute` attribute input
|
||||
--> $DIR/invalid-attributes.rs:19:1
|
||||
|
|
||||
LL | #[proc_macro_attribute = "test"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]`
|
||||
|
||||
error: malformed `proc_macro_attribute` attribute input
|
||||
--> $DIR/invalid-attributes.rs:22:1
|
||||
|
|
||||
LL | #[proc_macro_attribute()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]`
|
||||
|
||||
error: malformed `proc_macro_attribute` attribute input
|
||||
error[E0565]: malformed `proc_macro_attribute` attribute input
|
||||
--> $DIR/invalid-attributes.rs:25:1
|
||||
|
|
||||
LL | #[proc_macro_attribute = "test"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^--------^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_attribute]`
|
||||
|
||||
error[E0565]: malformed `proc_macro_attribute` attribute input
|
||||
--> $DIR/invalid-attributes.rs:30:1
|
||||
|
|
||||
LL | #[proc_macro_attribute()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^--^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_attribute]`
|
||||
|
||||
error[E0565]: malformed `proc_macro_attribute` attribute input
|
||||
--> $DIR/invalid-attributes.rs:35:1
|
||||
|
|
||||
LL | #[proc_macro_attribute(x)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^---^
|
||||
| | |
|
||||
| | didn't expect any arguments here
|
||||
| help: must be of the form: `#[proc_macro_attribute]`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0565`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue