diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-02-28 09:17:24 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-03-16 23:13:15 +0300 |
| commit | 8371caf5ee13e775d2b2dc64c9b08e37dab49eda (patch) | |
| tree | 630bb9b91f6f46469c6ec3eb51b21733c8e02e46 /src/test/ui/proc-macro | |
| parent | e2009ea5ffdacd767ea85d463fbe40d0e8b06951 (diff) | |
| download | rust-8371caf5ee13e775d2b2dc64c9b08e37dab49eda.tar.gz rust-8371caf5ee13e775d2b2dc64c9b08e37dab49eda.zip | |
syntax: Do not accidentally treat multi-segment meta-items as single-segment
Diffstat (limited to 'src/test/ui/proc-macro')
| -rw-r--r-- | src/test/ui/proc-macro/attribute.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/proc-macro/attribute.stderr | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/test/ui/proc-macro/attribute.rs b/src/test/ui/proc-macro/attribute.rs index f1775307fb4..750f63f9b6b 100644 --- a/src/test/ui/proc-macro/attribute.rs +++ b/src/test/ui/proc-macro/attribute.rs @@ -31,7 +31,7 @@ pub fn foo5(input: TokenStream) -> TokenStream { input } pub fn foo6(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(m::d7)] -//FIXME ERROR: must only be one word +//~^ ERROR: must only be one word pub fn foo7(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d8(a))] @@ -64,7 +64,7 @@ pub fn foo13(input: TokenStream) -> TokenStream { input } pub fn foo14(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d15, attributes(m::a))] -//FIXME ERROR: must only be one word +//~^ ERROR: must only be one word pub fn foo15(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d16, attributes(a(b)))] diff --git a/src/test/ui/proc-macro/attribute.stderr b/src/test/ui/proc-macro/attribute.stderr index 7bafb0abc4f..a1b3a4aaf29 100644 --- a/src/test/ui/proc-macro/attribute.stderr +++ b/src/test/ui/proc-macro/attribute.stderr @@ -23,6 +23,12 @@ LL | #[proc_macro_derive(d6 = "")] | ^^^^^^^ error: must only be one word + --> $DIR/attribute.rs:33:21 + | +LL | #[proc_macro_derive(m::d7)] + | ^^^^^ + +error: must only be one word --> $DIR/attribute.rs:37:21 | LL | #[proc_macro_derive(d8(a))] @@ -65,6 +71,12 @@ LL | #[proc_macro_derive(d14, attributes(a = ""))] | ^^^^^^ error: must only be one word + --> $DIR/attribute.rs:66:37 + | +LL | #[proc_macro_derive(d15, attributes(m::a))] + | ^^^^ + +error: must only be one word --> $DIR/attribute.rs:70:37 | LL | #[proc_macro_derive(d16, attributes(a(b)))] @@ -82,5 +94,5 @@ error: attribute must be of the form `#[proc_macro_derive(TraitName, /*opt*/ att LL | #[proc_macro_derive = ""] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 14 previous errors +error: aborting due to 16 previous errors |
