diff --git a/tests/ui/macros/expr_2021.rs b/tests/ui/macros/expr_2021.rs index 8a274e7753359..7ddeedc7a0b55 100644 --- a/tests/ui/macros/expr_2021.rs +++ b/tests/ui/macros/expr_2021.rs @@ -1,5 +1,6 @@ //@ check-pass //@ edition: 2015 +//@ reference: macro.decl.meta.edition2024 // Ensures expr_2021 fragment specifier is accepted in old editions diff --git a/tests/ui/macros/expr_2021_inline_const.edi2021.stderr b/tests/ui/macros/expr_2021_inline_const.edi2021.stderr index bf7eb3888b33e..997f1d1d73fd3 100644 --- a/tests/ui/macros/expr_2021_inline_const.edi2021.stderr +++ b/tests/ui/macros/expr_2021_inline_const.edi2021.stderr @@ -1,5 +1,5 @@ error: no rules expected keyword `const` - --> $DIR/expr_2021_inline_const.rs:23:12 + --> $DIR/expr_2021_inline_const.rs:24:12 | LL | macro_rules! m2021 { | ------------------ when calling this macro @@ -8,13 +8,13 @@ LL | m2021!(const { 1 }); | ^^^^^ no rules expected this token in macro call | note: while trying to match meta-variable `$e:expr_2021` - --> $DIR/expr_2021_inline_const.rs:7:6 + --> $DIR/expr_2021_inline_const.rs:8:6 | LL | ($e:expr_2021) => { | ^^^^^^^^^^^^ error: no rules expected keyword `const` - --> $DIR/expr_2021_inline_const.rs:24:12 + --> $DIR/expr_2021_inline_const.rs:25:12 | LL | macro_rules! m2024 { | ------------------ when calling this macro @@ -23,7 +23,7 @@ LL | m2024!(const { 1 }); | ^^^^^ no rules expected this token in macro call | note: while trying to match meta-variable `$e:expr` - --> $DIR/expr_2021_inline_const.rs:13:6 + --> $DIR/expr_2021_inline_const.rs:14:6 | LL | ($e:expr) => { | ^^^^^^^ diff --git a/tests/ui/macros/expr_2021_inline_const.edi2024.stderr b/tests/ui/macros/expr_2021_inline_const.edi2024.stderr index 1028ddc4267fc..659738c0bb992 100644 --- a/tests/ui/macros/expr_2021_inline_const.edi2024.stderr +++ b/tests/ui/macros/expr_2021_inline_const.edi2024.stderr @@ -1,5 +1,5 @@ error: no rules expected keyword `const` - --> $DIR/expr_2021_inline_const.rs:23:12 + --> $DIR/expr_2021_inline_const.rs:24:12 | LL | macro_rules! m2021 { | ------------------ when calling this macro @@ -8,7 +8,7 @@ LL | m2021!(const { 1 }); | ^^^^^ no rules expected this token in macro call | note: while trying to match meta-variable `$e:expr_2021` - --> $DIR/expr_2021_inline_const.rs:7:6 + --> $DIR/expr_2021_inline_const.rs:8:6 | LL | ($e:expr_2021) => { | ^^^^^^^^^^^^ diff --git a/tests/ui/macros/expr_2021_inline_const.rs b/tests/ui/macros/expr_2021_inline_const.rs index 257f5b2f8cf98..d660db12328cb 100644 --- a/tests/ui/macros/expr_2021_inline_const.rs +++ b/tests/ui/macros/expr_2021_inline_const.rs @@ -1,6 +1,7 @@ //@ revisions: edi2021 edi2024 //@[edi2024] edition: 2024 //@[edi2021] edition: 2021 +//@ reference: macro.decl.meta.edition2024 // This test ensures that the inline const match only on edition 2024 macro_rules! m2021 { diff --git a/tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr b/tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr index 7b3ca54bb7132..37be53aafc5b0 100644 --- a/tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr +++ b/tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr @@ -1,5 +1,5 @@ error: no rules expected reserved identifier `_` - --> $DIR/expr_2024_underscore_expr.rs:19:12 + --> $DIR/expr_2024_underscore_expr.rs:20:12 | LL | macro_rules! m2021 { | ------------------ when calling this macro @@ -8,13 +8,13 @@ LL | m2021!(_); | ^ no rules expected this token in macro call | note: while trying to match meta-variable `$e:expr_2021` - --> $DIR/expr_2024_underscore_expr.rs:7:6 + --> $DIR/expr_2024_underscore_expr.rs:8:6 | LL | ($e:expr_2021) => { | ^^^^^^^^^^^^ error: no rules expected reserved identifier `_` - --> $DIR/expr_2024_underscore_expr.rs:20:12 + --> $DIR/expr_2024_underscore_expr.rs:21:12 | LL | macro_rules! m2024 { | ------------------ when calling this macro @@ -23,7 +23,7 @@ LL | m2024!(_); | ^ no rules expected this token in macro call | note: while trying to match meta-variable `$e:expr` - --> $DIR/expr_2024_underscore_expr.rs:13:6 + --> $DIR/expr_2024_underscore_expr.rs:14:6 | LL | ($e:expr) => { | ^^^^^^^ diff --git a/tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr b/tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr index 59104dafa1816..831cbd09de9d0 100644 --- a/tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr +++ b/tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr @@ -1,5 +1,5 @@ error: no rules expected reserved identifier `_` - --> $DIR/expr_2024_underscore_expr.rs:19:12 + --> $DIR/expr_2024_underscore_expr.rs:20:12 | LL | macro_rules! m2021 { | ------------------ when calling this macro @@ -8,7 +8,7 @@ LL | m2021!(_); | ^ no rules expected this token in macro call | note: while trying to match meta-variable `$e:expr_2021` - --> $DIR/expr_2024_underscore_expr.rs:7:6 + --> $DIR/expr_2024_underscore_expr.rs:8:6 | LL | ($e:expr_2021) => { | ^^^^^^^^^^^^ diff --git a/tests/ui/macros/expr_2024_underscore_expr.rs b/tests/ui/macros/expr_2024_underscore_expr.rs index 1d45d60c13644..e216dbb191e18 100644 --- a/tests/ui/macros/expr_2024_underscore_expr.rs +++ b/tests/ui/macros/expr_2024_underscore_expr.rs @@ -1,6 +1,7 @@ //@ revisions: edi2021 edi2024 //@[edi2024] edition: 2024 //@[edi2021] edition: 2021 +//@ reference: macro.decl.meta.edition2024 // This test ensures that the `_` tok is considered an // expression on edition 2024. macro_rules! m2021 { diff --git a/tests/ui/macros/local-ambiguity-multiple-parsing-options.rs b/tests/ui/macros/local-ambiguity-multiple-parsing-options.rs index 3967481098cff..d15850d43a288 100644 --- a/tests/ui/macros/local-ambiguity-multiple-parsing-options.rs +++ b/tests/ui/macros/local-ambiguity-multiple-parsing-options.rs @@ -1,3 +1,4 @@ +//@ reference: macro.decl.transcription.lookahead fn main() {} macro_rules! ambiguity { diff --git a/tests/ui/macros/local-ambiguity-multiple-parsing-options.stderr b/tests/ui/macros/local-ambiguity-multiple-parsing-options.stderr index 68b278fd3c886..80fc66f7e36b6 100644 --- a/tests/ui/macros/local-ambiguity-multiple-parsing-options.stderr +++ b/tests/ui/macros/local-ambiguity-multiple-parsing-options.stderr @@ -1,11 +1,11 @@ error: local ambiguity when calling macro `ambiguity`: multiple parsing options: built-in NTs ident ('i') or ident ('j'). - --> $DIR/local-ambiguity-multiple-parsing-options.rs:7:12 + --> $DIR/local-ambiguity-multiple-parsing-options.rs:8:12 | LL | ambiguity!(error); | ^^^^^ error: local ambiguity when calling macro `ambiguity`: multiple parsing options: built-in NTs ident ('i') or ident ('j'). - --> $DIR/local-ambiguity-multiple-parsing-options.rs:8:12 + --> $DIR/local-ambiguity-multiple-parsing-options.rs:9:12 | LL | ambiguity!(error); | ^^^^^ diff --git a/tests/ui/macros/macro-error.rs b/tests/ui/macros/macro-error.rs index 4984b92911efc..20ae8c137a569 100644 --- a/tests/ui/macros/macro-error.rs +++ b/tests/ui/macros/macro-error.rs @@ -1,3 +1,4 @@ +//@ reference: macro.decl.syntax macro_rules! foo { ($a:expr) => a; //~ ERROR macro rhs must be delimited } diff --git a/tests/ui/macros/macro-error.stderr b/tests/ui/macros/macro-error.stderr index fcf8d922d65c9..f3bab7af9b640 100644 --- a/tests/ui/macros/macro-error.stderr +++ b/tests/ui/macros/macro-error.stderr @@ -1,11 +1,11 @@ error: macro rhs must be delimited - --> $DIR/macro-error.rs:2:18 + --> $DIR/macro-error.rs:3:18 | LL | ($a:expr) => a; | ^ error: non-type macro in type position: cfg - --> $DIR/macro-error.rs:8:12 + --> $DIR/macro-error.rs:9:12 | LL | let _: cfg!(FALSE) = (); | ^^^^^^^^^^^ diff --git a/tests/ui/macros/macro-follow-rpass.rs b/tests/ui/macros/macro-follow-rpass.rs index 8551b1887708e..66a32fd95af70 100644 --- a/tests/ui/macros/macro-follow-rpass.rs +++ b/tests/ui/macros/macro-follow-rpass.rs @@ -1,5 +1,10 @@ //@ edition:2015..2021 //@ run-pass +//@ reference: macro.decl.follow-set.token-expr-stmt +//@ reference: macro.decl.follow-set.token-pat +//@ reference: macro.decl.follow-set.edition2021 +//@ reference: macro.decl.follow-set.token-path-ty +//@ reference: macro.decl.follow-set.token-other #![allow(unused_macros)] // Check the macro follow sets (see corresponding cfail test). diff --git a/tests/ui/macros/macro-follow.rs b/tests/ui/macros/macro-follow.rs index 923c9bd6cedc9..eb3ef3fd333e6 100644 --- a/tests/ui/macros/macro-follow.rs +++ b/tests/ui/macros/macro-follow.rs @@ -1,5 +1,7 @@ //@ edition:2015..2021 -// +//@ reference: macro.decl.follow-set.token-expr-stmt +//@ reference: macro.decl.follow-set.token-pat +//@ reference: macro.decl.follow-set.token-path-ty // Check the macro follow sets (see corresponding rpass test). #![allow(unused_macros)] diff --git a/tests/ui/macros/macro-follow.stderr b/tests/ui/macros/macro-follow.stderr index 92491dc26d12b..28e793be8b5f4 100644 --- a/tests/ui/macros/macro-follow.stderr +++ b/tests/ui/macros/macro-follow.stderr @@ -1,5 +1,5 @@ error: `$p:pat` is followed by `(`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:9:13 + --> $DIR/macro-follow.rs:11:13 | LL | ($p:pat ()) => {}; | ^ not allowed after `pat` fragments @@ -7,7 +7,7 @@ LL | ($p:pat ()) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `[`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:10:13 + --> $DIR/macro-follow.rs:12:13 | LL | ($p:pat []) => {}; | ^ not allowed after `pat` fragments @@ -15,7 +15,7 @@ LL | ($p:pat []) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `{`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:11:13 + --> $DIR/macro-follow.rs:13:13 | LL | ($p:pat {}) => {}; | ^ not allowed after `pat` fragments @@ -23,7 +23,7 @@ LL | ($p:pat {}) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `:`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:12:13 + --> $DIR/macro-follow.rs:14:13 | LL | ($p:pat :) => {}; | ^ not allowed after `pat` fragments @@ -31,7 +31,7 @@ LL | ($p:pat :) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `>`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:13:13 + --> $DIR/macro-follow.rs:15:13 | LL | ($p:pat >) => {}; | ^ not allowed after `pat` fragments @@ -39,7 +39,7 @@ LL | ($p:pat >) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `+`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:14:13 + --> $DIR/macro-follow.rs:16:13 | LL | ($p:pat +) => {}; | ^ not allowed after `pat` fragments @@ -47,7 +47,7 @@ LL | ($p:pat +) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `ident`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:15:13 + --> $DIR/macro-follow.rs:17:13 | LL | ($p:pat ident) => {}; | ^^^^^ not allowed after `pat` fragments @@ -55,7 +55,7 @@ LL | ($p:pat ident) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$q:pat`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:16:13 + --> $DIR/macro-follow.rs:18:13 | LL | ($p:pat $q:pat) => {}; | ^^^^^^ not allowed after `pat` fragments @@ -63,7 +63,7 @@ LL | ($p:pat $q:pat) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$e:expr`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:17:13 + --> $DIR/macro-follow.rs:19:13 | LL | ($p:pat $e:expr) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -71,7 +71,7 @@ LL | ($p:pat $e:expr) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$t:ty`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:18:13 + --> $DIR/macro-follow.rs:20:13 | LL | ($p:pat $t:ty) => {}; | ^^^^^ not allowed after `pat` fragments @@ -79,7 +79,7 @@ LL | ($p:pat $t:ty) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$s:stmt`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:19:13 + --> $DIR/macro-follow.rs:21:13 | LL | ($p:pat $s:stmt) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -87,7 +87,7 @@ LL | ($p:pat $s:stmt) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$q:path`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:20:13 + --> $DIR/macro-follow.rs:22:13 | LL | ($p:pat $q:path) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -95,7 +95,7 @@ LL | ($p:pat $q:path) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$b:block`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:21:13 + --> $DIR/macro-follow.rs:23:13 | LL | ($p:pat $b:block) => {}; | ^^^^^^^^ not allowed after `pat` fragments @@ -103,7 +103,7 @@ LL | ($p:pat $b:block) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$i:ident`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:22:13 + --> $DIR/macro-follow.rs:24:13 | LL | ($p:pat $i:ident) => {}; | ^^^^^^^^ not allowed after `pat` fragments @@ -111,7 +111,7 @@ LL | ($p:pat $i:ident) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$t:tt`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:23:13 + --> $DIR/macro-follow.rs:25:13 | LL | ($p:pat $t:tt) => {}; | ^^^^^ not allowed after `pat` fragments @@ -119,7 +119,7 @@ LL | ($p:pat $t:tt) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$i:item`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:24:13 + --> $DIR/macro-follow.rs:26:13 | LL | ($p:pat $i:item) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -127,7 +127,7 @@ LL | ($p:pat $i:item) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$p:pat` is followed by `$m:meta`, which is not allowed for `pat` fragments - --> $DIR/macro-follow.rs:25:13 + --> $DIR/macro-follow.rs:27:13 | LL | ($p:pat $m:meta) => {}; | ^^^^^^^ not allowed after `pat` fragments @@ -135,7 +135,7 @@ LL | ($p:pat $m:meta) => {}; = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in` error: `$e:expr` is followed by `(`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:29:14 + --> $DIR/macro-follow.rs:31:14 | LL | ($e:expr ()) => {}; | ^ not allowed after `expr` fragments @@ -143,7 +143,7 @@ LL | ($e:expr ()) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `[`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:30:14 + --> $DIR/macro-follow.rs:32:14 | LL | ($e:expr []) => {}; | ^ not allowed after `expr` fragments @@ -151,7 +151,7 @@ LL | ($e:expr []) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `{`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:31:14 + --> $DIR/macro-follow.rs:33:14 | LL | ($e:expr {}) => {}; | ^ not allowed after `expr` fragments @@ -159,7 +159,7 @@ LL | ($e:expr {}) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `=`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:32:14 + --> $DIR/macro-follow.rs:34:14 | LL | ($e:expr =) => {}; | ^ not allowed after `expr` fragments @@ -167,7 +167,7 @@ LL | ($e:expr =) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `|`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:33:14 + --> $DIR/macro-follow.rs:35:14 | LL | ($e:expr |) => {}; | ^ not allowed after `expr` fragments @@ -175,7 +175,7 @@ LL | ($e:expr |) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `:`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:34:14 + --> $DIR/macro-follow.rs:36:14 | LL | ($e:expr :) => {}; | ^ not allowed after `expr` fragments @@ -183,7 +183,7 @@ LL | ($e:expr :) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `>`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:35:14 + --> $DIR/macro-follow.rs:37:14 | LL | ($e:expr >) => {}; | ^ not allowed after `expr` fragments @@ -191,7 +191,7 @@ LL | ($e:expr >) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `+`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:36:14 + --> $DIR/macro-follow.rs:38:14 | LL | ($e:expr +) => {}; | ^ not allowed after `expr` fragments @@ -199,7 +199,7 @@ LL | ($e:expr +) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `ident`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:37:14 + --> $DIR/macro-follow.rs:39:14 | LL | ($e:expr ident) => {}; | ^^^^^ not allowed after `expr` fragments @@ -207,7 +207,7 @@ LL | ($e:expr ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `if`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:38:14 + --> $DIR/macro-follow.rs:40:14 | LL | ($e:expr if) => {}; | ^^ not allowed after `expr` fragments @@ -215,7 +215,7 @@ LL | ($e:expr if) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `in`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:39:14 + --> $DIR/macro-follow.rs:41:14 | LL | ($e:expr in) => {}; | ^^ not allowed after `expr` fragments @@ -223,7 +223,7 @@ LL | ($e:expr in) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$p:pat`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:40:14 + --> $DIR/macro-follow.rs:42:14 | LL | ($e:expr $p:pat) => {}; | ^^^^^^ not allowed after `expr` fragments @@ -231,7 +231,7 @@ LL | ($e:expr $p:pat) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$f:expr`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:41:14 + --> $DIR/macro-follow.rs:43:14 | LL | ($e:expr $f:expr) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -239,7 +239,7 @@ LL | ($e:expr $f:expr) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$t:ty`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:42:14 + --> $DIR/macro-follow.rs:44:14 | LL | ($e:expr $t:ty) => {}; | ^^^^^ not allowed after `expr` fragments @@ -247,7 +247,7 @@ LL | ($e:expr $t:ty) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$s:stmt`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:43:14 + --> $DIR/macro-follow.rs:45:14 | LL | ($e:expr $s:stmt) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -255,7 +255,7 @@ LL | ($e:expr $s:stmt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$p:path`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:44:14 + --> $DIR/macro-follow.rs:46:14 | LL | ($e:expr $p:path) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -263,7 +263,7 @@ LL | ($e:expr $p:path) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$b:block`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:45:14 + --> $DIR/macro-follow.rs:47:14 | LL | ($e:expr $b:block) => {}; | ^^^^^^^^ not allowed after `expr` fragments @@ -271,7 +271,7 @@ LL | ($e:expr $b:block) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$i:ident`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:46:14 + --> $DIR/macro-follow.rs:48:14 | LL | ($e:expr $i:ident) => {}; | ^^^^^^^^ not allowed after `expr` fragments @@ -279,7 +279,7 @@ LL | ($e:expr $i:ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$t:tt`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:47:14 + --> $DIR/macro-follow.rs:49:14 | LL | ($e:expr $t:tt) => {}; | ^^^^^ not allowed after `expr` fragments @@ -287,7 +287,7 @@ LL | ($e:expr $t:tt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$i:item`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:48:14 + --> $DIR/macro-follow.rs:50:14 | LL | ($e:expr $i:item) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -295,7 +295,7 @@ LL | ($e:expr $i:item) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$m:meta`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:49:14 + --> $DIR/macro-follow.rs:51:14 | LL | ($e:expr $m:meta) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -303,7 +303,7 @@ LL | ($e:expr $m:meta) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$t:ty` is followed by `(`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:54:12 + --> $DIR/macro-follow.rs:56:12 | LL | ($t:ty ()) => {}; | ^ not allowed after `ty` fragments @@ -311,7 +311,7 @@ LL | ($t:ty ()) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `+`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:56:12 + --> $DIR/macro-follow.rs:58:12 | LL | ($t:ty +) => {}; | ^ not allowed after `ty` fragments @@ -319,7 +319,7 @@ LL | ($t:ty +) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `ident`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:57:12 + --> $DIR/macro-follow.rs:59:12 | LL | ($t:ty ident) => {}; | ^^^^^ not allowed after `ty` fragments @@ -327,7 +327,7 @@ LL | ($t:ty ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `if`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:58:12 + --> $DIR/macro-follow.rs:60:12 | LL | ($t:ty if) => {}; | ^^ not allowed after `ty` fragments @@ -335,7 +335,7 @@ LL | ($t:ty if) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$p:pat`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:59:12 + --> $DIR/macro-follow.rs:61:12 | LL | ($t:ty $p:pat) => {}; | ^^^^^^ not allowed after `ty` fragments @@ -343,7 +343,7 @@ LL | ($t:ty $p:pat) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$e:expr`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:60:12 + --> $DIR/macro-follow.rs:62:12 | LL | ($t:ty $e:expr) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -351,7 +351,7 @@ LL | ($t:ty $e:expr) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$r:ty`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:61:12 + --> $DIR/macro-follow.rs:63:12 | LL | ($t:ty $r:ty) => {}; | ^^^^^ not allowed after `ty` fragments @@ -359,7 +359,7 @@ LL | ($t:ty $r:ty) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$s:stmt`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:62:12 + --> $DIR/macro-follow.rs:64:12 | LL | ($t:ty $s:stmt) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -367,7 +367,7 @@ LL | ($t:ty $s:stmt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$p:path`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:63:12 + --> $DIR/macro-follow.rs:65:12 | LL | ($t:ty $p:path) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -375,7 +375,7 @@ LL | ($t:ty $p:path) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$i:ident`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:65:12 + --> $DIR/macro-follow.rs:67:12 | LL | ($t:ty $i:ident) => {}; | ^^^^^^^^ not allowed after `ty` fragments @@ -383,7 +383,7 @@ LL | ($t:ty $i:ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$r:tt`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:66:12 + --> $DIR/macro-follow.rs:68:12 | LL | ($t:ty $r:tt) => {}; | ^^^^^ not allowed after `ty` fragments @@ -391,7 +391,7 @@ LL | ($t:ty $r:tt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$i:item`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:67:12 + --> $DIR/macro-follow.rs:69:12 | LL | ($t:ty $i:item) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -399,7 +399,7 @@ LL | ($t:ty $i:item) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$m:meta`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:68:12 + --> $DIR/macro-follow.rs:70:12 | LL | ($t:ty $m:meta) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -407,7 +407,7 @@ LL | ($t:ty $m:meta) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$s:stmt` is followed by `(`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:72:14 + --> $DIR/macro-follow.rs:74:14 | LL | ($s:stmt ()) => {}; | ^ not allowed after `stmt` fragments @@ -415,7 +415,7 @@ LL | ($s:stmt ()) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `[`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:73:14 + --> $DIR/macro-follow.rs:75:14 | LL | ($s:stmt []) => {}; | ^ not allowed after `stmt` fragments @@ -423,7 +423,7 @@ LL | ($s:stmt []) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `{`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:74:14 + --> $DIR/macro-follow.rs:76:14 | LL | ($s:stmt {}) => {}; | ^ not allowed after `stmt` fragments @@ -431,7 +431,7 @@ LL | ($s:stmt {}) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `=`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:75:14 + --> $DIR/macro-follow.rs:77:14 | LL | ($s:stmt =) => {}; | ^ not allowed after `stmt` fragments @@ -439,7 +439,7 @@ LL | ($s:stmt =) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `|`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:76:14 + --> $DIR/macro-follow.rs:78:14 | LL | ($s:stmt |) => {}; | ^ not allowed after `stmt` fragments @@ -447,7 +447,7 @@ LL | ($s:stmt |) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `:`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:77:14 + --> $DIR/macro-follow.rs:79:14 | LL | ($s:stmt :) => {}; | ^ not allowed after `stmt` fragments @@ -455,7 +455,7 @@ LL | ($s:stmt :) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `>`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:78:14 + --> $DIR/macro-follow.rs:80:14 | LL | ($s:stmt >) => {}; | ^ not allowed after `stmt` fragments @@ -463,7 +463,7 @@ LL | ($s:stmt >) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `+`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:79:14 + --> $DIR/macro-follow.rs:81:14 | LL | ($s:stmt +) => {}; | ^ not allowed after `stmt` fragments @@ -471,7 +471,7 @@ LL | ($s:stmt +) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `ident`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:80:14 + --> $DIR/macro-follow.rs:82:14 | LL | ($s:stmt ident) => {}; | ^^^^^ not allowed after `stmt` fragments @@ -479,7 +479,7 @@ LL | ($s:stmt ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `if`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:81:14 + --> $DIR/macro-follow.rs:83:14 | LL | ($s:stmt if) => {}; | ^^ not allowed after `stmt` fragments @@ -487,7 +487,7 @@ LL | ($s:stmt if) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `in`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:82:14 + --> $DIR/macro-follow.rs:84:14 | LL | ($s:stmt in) => {}; | ^^ not allowed after `stmt` fragments @@ -495,7 +495,7 @@ LL | ($s:stmt in) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$p:pat`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:83:14 + --> $DIR/macro-follow.rs:85:14 | LL | ($s:stmt $p:pat) => {}; | ^^^^^^ not allowed after `stmt` fragments @@ -503,7 +503,7 @@ LL | ($s:stmt $p:pat) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$e:expr`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:84:14 + --> $DIR/macro-follow.rs:86:14 | LL | ($s:stmt $e:expr) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -511,7 +511,7 @@ LL | ($s:stmt $e:expr) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$t:ty`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:85:14 + --> $DIR/macro-follow.rs:87:14 | LL | ($s:stmt $t:ty) => {}; | ^^^^^ not allowed after `stmt` fragments @@ -519,7 +519,7 @@ LL | ($s:stmt $t:ty) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$t:stmt`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:86:14 + --> $DIR/macro-follow.rs:88:14 | LL | ($s:stmt $t:stmt) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -527,7 +527,7 @@ LL | ($s:stmt $t:stmt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$p:path`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:87:14 + --> $DIR/macro-follow.rs:89:14 | LL | ($s:stmt $p:path) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -535,7 +535,7 @@ LL | ($s:stmt $p:path) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$b:block`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:88:14 + --> $DIR/macro-follow.rs:90:14 | LL | ($s:stmt $b:block) => {}; | ^^^^^^^^ not allowed after `stmt` fragments @@ -543,7 +543,7 @@ LL | ($s:stmt $b:block) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$i:ident`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:89:14 + --> $DIR/macro-follow.rs:91:14 | LL | ($s:stmt $i:ident) => {}; | ^^^^^^^^ not allowed after `stmt` fragments @@ -551,7 +551,7 @@ LL | ($s:stmt $i:ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$t:tt`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:90:14 + --> $DIR/macro-follow.rs:92:14 | LL | ($s:stmt $t:tt) => {}; | ^^^^^ not allowed after `stmt` fragments @@ -559,7 +559,7 @@ LL | ($s:stmt $t:tt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$i:item`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:91:14 + --> $DIR/macro-follow.rs:93:14 | LL | ($s:stmt $i:item) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -567,7 +567,7 @@ LL | ($s:stmt $i:item) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$m:meta`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:92:14 + --> $DIR/macro-follow.rs:94:14 | LL | ($s:stmt $m:meta) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -575,7 +575,7 @@ LL | ($s:stmt $m:meta) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$p:path` is followed by `(`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:96:14 + --> $DIR/macro-follow.rs:98:14 | LL | ($p:path ()) => {}; | ^ not allowed after `path` fragments @@ -583,7 +583,7 @@ LL | ($p:path ()) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `+`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:98:14 + --> $DIR/macro-follow.rs:100:14 | LL | ($p:path +) => {}; | ^ not allowed after `path` fragments @@ -591,7 +591,7 @@ LL | ($p:path +) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `ident`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:99:14 + --> $DIR/macro-follow.rs:101:14 | LL | ($p:path ident) => {}; | ^^^^^ not allowed after `path` fragments @@ -599,7 +599,7 @@ LL | ($p:path ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `if`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:100:14 + --> $DIR/macro-follow.rs:102:14 | LL | ($p:path if) => {}; | ^^ not allowed after `path` fragments @@ -607,7 +607,7 @@ LL | ($p:path if) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$q:pat`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:101:14 + --> $DIR/macro-follow.rs:103:14 | LL | ($p:path $q:pat) => {}; | ^^^^^^ not allowed after `path` fragments @@ -615,7 +615,7 @@ LL | ($p:path $q:pat) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$e:expr`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:102:14 + --> $DIR/macro-follow.rs:104:14 | LL | ($p:path $e:expr) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -623,7 +623,7 @@ LL | ($p:path $e:expr) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$t:ty`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:103:14 + --> $DIR/macro-follow.rs:105:14 | LL | ($p:path $t:ty) => {}; | ^^^^^ not allowed after `path` fragments @@ -631,7 +631,7 @@ LL | ($p:path $t:ty) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$s:stmt`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:104:14 + --> $DIR/macro-follow.rs:106:14 | LL | ($p:path $s:stmt) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -639,7 +639,7 @@ LL | ($p:path $s:stmt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$q:path`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:105:14 + --> $DIR/macro-follow.rs:107:14 | LL | ($p:path $q:path) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -647,7 +647,7 @@ LL | ($p:path $q:path) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$i:ident`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:107:14 + --> $DIR/macro-follow.rs:109:14 | LL | ($p:path $i:ident) => {}; | ^^^^^^^^ not allowed after `path` fragments @@ -655,7 +655,7 @@ LL | ($p:path $i:ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$t:tt`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:108:14 + --> $DIR/macro-follow.rs:110:14 | LL | ($p:path $t:tt) => {}; | ^^^^^ not allowed after `path` fragments @@ -663,7 +663,7 @@ LL | ($p:path $t:tt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$i:item`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:109:14 + --> $DIR/macro-follow.rs:111:14 | LL | ($p:path $i:item) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -671,7 +671,7 @@ LL | ($p:path $i:item) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$m:meta`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:110:14 + --> $DIR/macro-follow.rs:112:14 | LL | ($p:path $m:meta) => {}; | ^^^^^^^ not allowed after `path` fragments diff --git a/tests/ui/macros/macro-followed-by-seq-bad.rs b/tests/ui/macros/macro-followed-by-seq-bad.rs index b73742f77ea58..ba72a6504885a 100644 --- a/tests/ui/macros/macro-followed-by-seq-bad.rs +++ b/tests/ui/macros/macro-followed-by-seq-bad.rs @@ -1,3 +1,4 @@ +//@ reference: macro.decl.follow-set.repetition // Regression test for issue #25436: check that things which can be // followed by any token also permit X* to come afterwards. diff --git a/tests/ui/macros/macro-followed-by-seq-bad.stderr b/tests/ui/macros/macro-followed-by-seq-bad.stderr index 7097979aeddf3..1621bd8ccf405 100644 --- a/tests/ui/macros/macro-followed-by-seq-bad.stderr +++ b/tests/ui/macros/macro-followed-by-seq-bad.stderr @@ -1,5 +1,5 @@ error: `$a:expr` is followed by `$b:tt`, which is not allowed for `expr` fragments - --> $DIR/macro-followed-by-seq-bad.rs:7:15 + --> $DIR/macro-followed-by-seq-bad.rs:8:15 | LL | ( $a:expr $($b:tt)* ) => { }; | ^^^^^ not allowed after `expr` fragments @@ -7,7 +7,7 @@ LL | ( $a:expr $($b:tt)* ) => { }; = note: allowed there are: `=>`, `,` or `;` error: `$a:ty` is followed by `$b:tt`, which is not allowed for `ty` fragments - --> $DIR/macro-followed-by-seq-bad.rs:8:13 + --> $DIR/macro-followed-by-seq-bad.rs:9:13 | LL | ( $a:ty $($b:tt)* ) => { }; | ^^^^^ not allowed after `ty` fragments diff --git a/tests/ui/macros/macro-followed-by-seq.rs b/tests/ui/macros/macro-followed-by-seq.rs index f4756d42088ad..a2ec1a5b9e991 100644 --- a/tests/ui/macros/macro-followed-by-seq.rs +++ b/tests/ui/macros/macro-followed-by-seq.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ reference: macro.decl.follow-set.repetition #![allow(unused_macros)] // Regression test for issue #25436: check that things which can be // followed by any token also permit X* to come afterwards. diff --git a/tests/ui/macros/macro-hygiene-help-issue-148580.rs b/tests/ui/macros/macro-hygiene-help-issue-148580.rs index 8441290b17228..7f834c28c0989 100644 --- a/tests/ui/macros/macro-hygiene-help-issue-148580.rs +++ b/tests/ui/macros/macro-hygiene-help-issue-148580.rs @@ -1,3 +1,4 @@ +//@ reference: macro.decl.hygiene.intro macro_rules! print_it { {} => { println!("{:?}", it); } } //~^ ERROR cannot find value `it` in this scope diff --git a/tests/ui/macros/macro-hygiene-help-issue-148580.stderr b/tests/ui/macros/macro-hygiene-help-issue-148580.stderr index f6a4ae7dd1c66..56e021078855e 100644 --- a/tests/ui/macros/macro-hygiene-help-issue-148580.stderr +++ b/tests/ui/macros/macro-hygiene-help-issue-148580.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `it` in this scope - --> $DIR/macro-hygiene-help-issue-148580.rs:1:50 + --> $DIR/macro-hygiene-help-issue-148580.rs:2:50 | LL | macro_rules! print_it { {} => { println!("{:?}", it); } } | ^^ not found in this scope @@ -8,7 +8,7 @@ LL | print_it!(); | ----------- in this macro invocation | help: an identifier with the same name exists, but is not accessible due to macro hygiene - --> $DIR/macro-hygiene-help-issue-148580.rs:11:17 + --> $DIR/macro-hygiene-help-issue-148580.rs:12:17 | LL | let it = (); | ^^ diff --git a/tests/ui/macros/macro-hygiene-help-issue-149604.rs b/tests/ui/macros/macro-hygiene-help-issue-149604.rs index 5700218cc8671..2c01230fbe5df 100644 --- a/tests/ui/macros/macro-hygiene-help-issue-149604.rs +++ b/tests/ui/macros/macro-hygiene-help-issue-149604.rs @@ -1,3 +1,4 @@ +//@ reference: macro.decl.hygiene.intro macro_rules! let_it { {} => { let it = (); } } macro_rules! print_it { {} => { println!("{:?}", it); } } //~^ ERROR cannot find value `it` in this scope diff --git a/tests/ui/macros/macro-hygiene-help-issue-149604.stderr b/tests/ui/macros/macro-hygiene-help-issue-149604.stderr index dc95cb7a43f00..6df7c009e668b 100644 --- a/tests/ui/macros/macro-hygiene-help-issue-149604.stderr +++ b/tests/ui/macros/macro-hygiene-help-issue-149604.stderr @@ -1,11 +1,11 @@ error[E0425]: cannot find value `it` in this scope - --> $DIR/macro-hygiene-help-issue-149604.rs:7:14 + --> $DIR/macro-hygiene-help-issue-149604.rs:8:14 | LL | let () = it; | ^^ not found in this scope | help: an identifier with the same name is defined here, but is not accessible due to macro hygiene - --> $DIR/macro-hygiene-help-issue-149604.rs:1:35 + --> $DIR/macro-hygiene-help-issue-149604.rs:2:35 | LL | macro_rules! let_it { {} => { let it = (); } } | ^^ @@ -15,7 +15,7 @@ LL | let_it!(); = note: this error originates in the macro `let_it` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `it` in this scope - --> $DIR/macro-hygiene-help-issue-149604.rs:2:50 + --> $DIR/macro-hygiene-help-issue-149604.rs:3:50 | LL | macro_rules! print_it { {} => { println!("{:?}", it); } } | ^^ not found in this scope @@ -24,7 +24,7 @@ LL | print_it!(); | ----------- in this macro invocation | help: an identifier with the same name is defined here, but is not accessible due to macro hygiene - --> $DIR/macro-hygiene-help-issue-149604.rs:1:35 + --> $DIR/macro-hygiene-help-issue-149604.rs:2:35 | LL | macro_rules! let_it { {} => { let it = (); } } | ^^ diff --git a/tests/ui/macros/macro-hygiene-scope-15167.rs b/tests/ui/macros/macro-hygiene-scope-15167.rs index 6578f898a5fb4..ec54f2a7e9887 100644 --- a/tests/ui/macros/macro-hygiene-scope-15167.rs +++ b/tests/ui/macros/macro-hygiene-scope-15167.rs @@ -1,3 +1,4 @@ +//@ reference: macro.decl.hygiene.intro //! Regression test for https://github.com/rust-lang/rust/issues/15167 // macro f should not be able to inject a reference to 'n'. diff --git a/tests/ui/macros/macro-hygiene-scope-15167.stderr b/tests/ui/macros/macro-hygiene-scope-15167.stderr index 332a58467cee1..dbb0514ba1aab 100644 --- a/tests/ui/macros/macro-hygiene-scope-15167.stderr +++ b/tests/ui/macros/macro-hygiene-scope-15167.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `n` in this scope - --> $DIR/macro-hygiene-scope-15167.rs:5:25 + --> $DIR/macro-hygiene-scope-15167.rs:6:25 | LL | macro_rules! f { () => (n) } | ^ not found in this scope @@ -8,14 +8,14 @@ LL | println!("{}", f!()); | ---- in this macro invocation | help: an identifier with the same name exists, but is not accessible due to macro hygiene - --> $DIR/macro-hygiene-scope-15167.rs:12:9 + --> $DIR/macro-hygiene-scope-15167.rs:13:9 | LL | for n in 0..1 { | ^ = note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `n` in this scope - --> $DIR/macro-hygiene-scope-15167.rs:5:25 + --> $DIR/macro-hygiene-scope-15167.rs:6:25 | LL | macro_rules! f { () => (n) } | ^ not found in this scope @@ -24,14 +24,14 @@ LL | println!("{}", f!()); | ---- in this macro invocation | help: an identifier with the same name exists, but is not accessible due to macro hygiene - --> $DIR/macro-hygiene-scope-15167.rs:16:17 + --> $DIR/macro-hygiene-scope-15167.rs:17:17 | LL | if let Some(n) = None { | ^ = note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `n` in this scope - --> $DIR/macro-hygiene-scope-15167.rs:5:25 + --> $DIR/macro-hygiene-scope-15167.rs:6:25 | LL | macro_rules! f { () => (n) } | ^ not found in this scope @@ -40,14 +40,14 @@ LL | println!("{}", f!()); | ---- in this macro invocation | help: an identifier with the same name exists, but is not accessible due to macro hygiene - --> $DIR/macro-hygiene-scope-15167.rs:21:24 + --> $DIR/macro-hygiene-scope-15167.rs:22:24 | LL | } else if let Some(n) = None { | ^ = note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `n` in this scope - --> $DIR/macro-hygiene-scope-15167.rs:5:25 + --> $DIR/macro-hygiene-scope-15167.rs:6:25 | LL | macro_rules! f { () => (n) } | ^ not found in this scope @@ -56,7 +56,7 @@ LL | println!("{}", f!()); | ---- in this macro invocation | help: an identifier with the same name exists, but is not accessible due to macro hygiene - --> $DIR/macro-hygiene-scope-15167.rs:25:20 + --> $DIR/macro-hygiene-scope-15167.rs:26:20 | LL | while let Some(n) = None { | ^ diff --git a/tests/ui/macros/macro-or-patterns-back-compat.fixed b/tests/ui/macros/macro-or-patterns-back-compat.fixed index 5ff249ee17492..0321a36ae3b07 100644 --- a/tests/ui/macros/macro-or-patterns-back-compat.fixed +++ b/tests/ui/macros/macro-or-patterns-back-compat.fixed @@ -1,6 +1,7 @@ //@ edition:2015 //@ run-rustfix //@ aux-build:or-pattern.rs +//@ reference: macro.decl.follow-set.edition2021 #![deny(rust_2021_incompatible_or_patterns)] #![allow(unused_macros)] diff --git a/tests/ui/macros/macro-or-patterns-back-compat.rs b/tests/ui/macros/macro-or-patterns-back-compat.rs index 1c7beaeed7751..5d96ad456dc94 100644 --- a/tests/ui/macros/macro-or-patterns-back-compat.rs +++ b/tests/ui/macros/macro-or-patterns-back-compat.rs @@ -1,6 +1,7 @@ //@ edition:2015 //@ run-rustfix //@ aux-build:or-pattern.rs +//@ reference: macro.decl.follow-set.edition2021 #![deny(rust_2021_incompatible_or_patterns)] #![allow(unused_macros)] diff --git a/tests/ui/macros/macro-or-patterns-back-compat.stderr b/tests/ui/macros/macro-or-patterns-back-compat.stderr index 3718bcb4c8cc4..d4c2c57d0a8bb 100644 --- a/tests/ui/macros/macro-or-patterns-back-compat.stderr +++ b/tests/ui/macros/macro-or-patterns-back-compat.stderr @@ -1,5 +1,5 @@ error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro - --> $DIR/macro-or-patterns-back-compat.rs:11:21 + --> $DIR/macro-or-patterns-back-compat.rs:12:21 | LL | macro_rules! foo { ($x:pat | $y:pat) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` @@ -7,13 +7,13 @@ LL | macro_rules! foo { ($x:pat | $y:pat) => {} } = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/macro-or-patterns-back-compat.rs:5:9 + --> $DIR/macro-or-patterns-back-compat.rs:6:9 | LL | #![deny(rust_2021_incompatible_or_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro - --> $DIR/macro-or-patterns-back-compat.rs:14:23 + --> $DIR/macro-or-patterns-back-compat.rs:15:23 | LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` @@ -22,7 +22,7 @@ LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } = note: for more information, see error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro - --> $DIR/macro-or-patterns-back-compat.rs:20:21 + --> $DIR/macro-or-patterns-back-compat.rs:21:21 | LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` @@ -31,7 +31,7 @@ LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } = note: for more information, see error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro - --> $DIR/macro-or-patterns-back-compat.rs:24:26 + --> $DIR/macro-or-patterns-back-compat.rs:25:26 | LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { | ^^^^^^^^ help: use pat_param to preserve semantics: `$pat:pat_param` diff --git a/tests/ui/macros/macro-pat-follow-2018.rs b/tests/ui/macros/macro-pat-follow-2018.rs index 6dcb841fec15f..288e9c77832e8 100644 --- a/tests/ui/macros/macro-pat-follow-2018.rs +++ b/tests/ui/macros/macro-pat-follow-2018.rs @@ -1,5 +1,6 @@ //@ run-pass //@ edition:2018 +//@ reference: macro.decl.follow-set.edition2021 macro_rules! pat_bar { ($p:pat | $p2:pat) => {{ diff --git a/tests/ui/macros/macro-pat-follow.rs b/tests/ui/macros/macro-pat-follow.rs index 830cc7c0860d1..dfea3e8f7630e 100644 --- a/tests/ui/macros/macro-pat-follow.rs +++ b/tests/ui/macros/macro-pat-follow.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ reference: macro.decl.follow-set.token-pat macro_rules! pat_in { ($p:pat in $e:expr) => {{ let mut iter = $e.into_iter(); diff --git a/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs b/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs index 154d6e339a7f9..b300398dd666f 100644 --- a/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs +++ b/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs @@ -1,4 +1,5 @@ //@ edition:2021 +//@ reference: macro.decl.follow-set.token-pat #![allow(unused_macros)] macro_rules! foo { ($x:pat | $y:pat) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments diff --git a/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr b/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr index a06487be3d601..cf7bfee3955c8 100644 --- a/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr +++ b/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr @@ -1,5 +1,5 @@ error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments - --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:3:28 + --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:4:28 | LL | macro_rules! foo { ($x:pat | $y:pat) => {} } | ------ ^ not allowed after `pat` fragments @@ -9,7 +9,7 @@ LL | macro_rules! foo { ($x:pat | $y:pat) => {} } = note: allowed there are: `=>`, `,`, `=`, `if` or `in` error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments - --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:4:32 + --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:5:32 | LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } | ------ ^ not allowed after `pat` fragments @@ -19,7 +19,7 @@ LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } = note: allowed there are: `=>`, `,`, `=`, `if` or `in` error: `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments - --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:7:36 + --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:8:36 | LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { | -------- ^ not allowed after `pat` fragments diff --git a/tests/ui/macros/macro-pat-pattern-followed-by-or.rs b/tests/ui/macros/macro-pat-pattern-followed-by-or.rs index 59d26a9af2e10..f5a56a7e8edda 100644 --- a/tests/ui/macros/macro-pat-pattern-followed-by-or.rs +++ b/tests/ui/macros/macro-pat-pattern-followed-by-or.rs @@ -1,5 +1,7 @@ //@ edition:2015..2021 //@ run-pass +//@ reference: macro.decl.follow-set.token-pat +//@ reference: macro.decl.follow-set.edition2021 #![allow(unused_macros)] macro_rules! foo { ($x:pat | $y:pat) => {} } // should be ok macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } // should be ok diff --git a/tests/ui/macros/macro-pat2021-pattern-followed-by-or.rs b/tests/ui/macros/macro-pat2021-pattern-followed-by-or.rs index c7dc5d53a9862..a690503a802af 100644 --- a/tests/ui/macros/macro-pat2021-pattern-followed-by-or.rs +++ b/tests/ui/macros/macro-pat2021-pattern-followed-by-or.rs @@ -1,4 +1,6 @@ //@ edition:2021 +//@ reference: macro.decl.follow-set.token-pat +//@ reference: macro.decl.follow-set.edition2021 #![allow(unused_macros)] macro_rules! foo { ($x:pat | $y:pat) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments diff --git a/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr b/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr index c3754dde080a3..c1086f8939f6b 100644 --- a/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr +++ b/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr @@ -1,5 +1,5 @@ error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments - --> $DIR/macro-pat2021-pattern-followed-by-or.rs:4:28 + --> $DIR/macro-pat2021-pattern-followed-by-or.rs:6:28 | LL | macro_rules! foo { ($x:pat | $y:pat) => {} } | ------ ^ not allowed after `pat` fragments @@ -9,7 +9,7 @@ LL | macro_rules! foo { ($x:pat | $y:pat) => {} } = note: allowed there are: `=>`, `,`, `=`, `if` or `in` error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments - --> $DIR/macro-pat2021-pattern-followed-by-or.rs:7:28 + --> $DIR/macro-pat2021-pattern-followed-by-or.rs:9:28 | LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } | ------ ^ not allowed after `pat` fragments @@ -19,7 +19,7 @@ LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } = note: allowed there are: `=>`, `,`, `=`, `if` or `in` error: `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments - --> $DIR/macro-pat2021-pattern-followed-by-or.rs:9:35 + --> $DIR/macro-pat2021-pattern-followed-by-or.rs:11:35 | LL | ( $expr:expr , $( $( $pat:pat)|+ => $expr_arm:pat),+ ) => { | -------- ^ not allowed after `pat` fragments diff --git a/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs index a556983e204df..89824c4444974 100644 --- a/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs +++ b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs @@ -1,3 +1,4 @@ +//@ reference: attributes.derive.behavior #![crate_type = "lib"] macro_rules! sample { () => {} } diff --git a/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr index a3c21df43e758..43e893ecb3141 100644 --- a/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr +++ b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr @@ -1,5 +1,5 @@ error: cannot find attribute `sample` in this scope - --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:5:3 + --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:6:3 | LL | macro_rules! sample { () => {} } | ------ `sample` exists, but has no `attr` rules @@ -8,7 +8,7 @@ LL | #[sample] | ^^^^^^ error: cannot find derive macro `sample` in this scope - --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:6:10 + --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:7:10 | LL | macro_rules! sample { () => {} } | ------ `sample` exists, but has no `derive` rules @@ -17,7 +17,7 @@ LL | #[derive(sample)] | ^^^^^^ error: cannot find derive macro `sample` in this scope - --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:6:10 + --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:7:10 | LL | macro_rules! sample { () => {} } | ------ `sample` exists, but has no `derive` rules diff --git a/tests/ui/macros/macro-shadowing.rs b/tests/ui/macros/macro-shadowing.rs index 710e83dfb3b99..da971cbc751e3 100644 --- a/tests/ui/macros/macro-shadowing.rs +++ b/tests/ui/macros/macro-shadowing.rs @@ -1,4 +1,5 @@ //@ aux-build:two_macros.rs +//@ reference: macro.decl.scope.textual.shadow #![allow(unused_macros)] diff --git a/tests/ui/macros/macro-shadowing.stderr b/tests/ui/macros/macro-shadowing.stderr index a052b43ac10e4..0dc6bc41e9d06 100644 --- a/tests/ui/macros/macro-shadowing.stderr +++ b/tests/ui/macros/macro-shadowing.stderr @@ -1,5 +1,5 @@ error: `macro_two` is already in scope - --> $DIR/macro-shadowing.rs:12:5 + --> $DIR/macro-shadowing.rs:13:5 | LL | #[macro_use] | ^^^^^^^^^^^^ @@ -11,14 +11,14 @@ LL | m1!(); = note: this error originates in the macro `m1` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `foo` is ambiguous - --> $DIR/macro-shadowing.rs:17:1 + --> $DIR/macro-shadowing.rs:18:1 | LL | foo!(); | ^^^ ambiguous name | = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution note: `foo` could refer to the macro defined here - --> $DIR/macro-shadowing.rs:10:5 + --> $DIR/macro-shadowing.rs:11:5 | LL | macro_rules! foo { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | macro_rules! foo { () => {} } LL | m1!(); | ----- in this macro invocation note: `foo` could also refer to the macro defined here - --> $DIR/macro-shadowing.rs:5:1 + --> $DIR/macro-shadowing.rs:6:1 | LL | macro_rules! foo { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/macros/macro-use-all-and-none.rs b/tests/ui/macros/macro-use-all-and-none.rs index f1acff4840382..1fe89c77e3694 100644 --- a/tests/ui/macros/macro-use-all-and-none.rs +++ b/tests/ui/macros/macro-use-all-and-none.rs @@ -1,5 +1,6 @@ //@ run-pass //@ aux-build:two_macros-rpass.rs +//@ reference: macro.decl.scope.macro_use.duplicates #![warn(unused_attributes)] diff --git a/tests/ui/macros/macro-use-all-and-none.stderr b/tests/ui/macros/macro-use-all-and-none.stderr index b4c05adcb33d0..0b137ef040958 100644 --- a/tests/ui/macros/macro-use-all-and-none.stderr +++ b/tests/ui/macros/macro-use-all-and-none.stderr @@ -1,12 +1,12 @@ warning: unused attribute - --> $DIR/macro-use-all-and-none.rs:7:12 + --> $DIR/macro-use-all-and-none.rs:8:12 | LL | #[macro_use()] | ^^ help: remove these parentheses | = note: using `macro_use` with an empty list is equivalent to not using a list at all note: the lint level is defined here - --> $DIR/macro-use-all-and-none.rs:4:9 + --> $DIR/macro-use-all-and-none.rs:5:9 | LL | #![warn(unused_attributes)] | ^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/macros/macro-use-bad-args-1.rs b/tests/ui/macros/macro-use-bad-args-1.rs index bfc19981804d0..0f078da44009a 100644 --- a/tests/ui/macros/macro-use-bad-args-1.rs +++ b/tests/ui/macros/macro-use-bad-args-1.rs @@ -1,3 +1,4 @@ +//@ reference: macro.decl.scope.macro_use.syntax #![no_std] #[macro_use(foo(bar))] //~ ERROR malformed `macro_use` attribute input diff --git a/tests/ui/macros/macro-use-bad-args-1.stderr b/tests/ui/macros/macro-use-bad-args-1.stderr index 542b4ae2b7a5e..d1b6b39e4ec17 100644 --- a/tests/ui/macros/macro-use-bad-args-1.stderr +++ b/tests/ui/macros/macro-use-bad-args-1.stderr @@ -1,5 +1,5 @@ error[E0565]: malformed `macro_use` attribute input - --> $DIR/macro-use-bad-args-1.rs:3:1 + --> $DIR/macro-use-bad-args-1.rs:4:1 | LL | #[macro_use(foo(bar))] | ^^^^^^^^^^^^^^^-----^^ diff --git a/tests/ui/macros/macro-use-bad-args-2.rs b/tests/ui/macros/macro-use-bad-args-2.rs index e328b6285d91e..86cb09a66756c 100644 --- a/tests/ui/macros/macro-use-bad-args-2.rs +++ b/tests/ui/macros/macro-use-bad-args-2.rs @@ -1,3 +1,4 @@ +//@ reference: macro.decl.scope.macro_use.syntax #![no_std] #[macro_use(foo="bar")] //~ ERROR malformed `macro_use` attribute input diff --git a/tests/ui/macros/macro-use-bad-args-2.stderr b/tests/ui/macros/macro-use-bad-args-2.stderr index 2db9ffe50b042..f5b577a1ca934 100644 --- a/tests/ui/macros/macro-use-bad-args-2.stderr +++ b/tests/ui/macros/macro-use-bad-args-2.stderr @@ -1,5 +1,5 @@ error[E0565]: malformed `macro_use` attribute input - --> $DIR/macro-use-bad-args-2.rs:3:1 + --> $DIR/macro-use-bad-args-2.rs:4:1 | LL | #[macro_use(foo="bar")] | ^^^^^^^^^^^^^^^------^^ diff --git a/tests/ui/macros/macro-use-both.rs b/tests/ui/macros/macro-use-both.rs index e49f346c8e3e8..fc2d720d701de 100644 --- a/tests/ui/macros/macro-use-both.rs +++ b/tests/ui/macros/macro-use-both.rs @@ -1,5 +1,7 @@ //@ run-pass //@ aux-build:two_macros.rs +//@ reference: macro.decl.scope.macro_use.syntax +//@ reference: macro.decl.scope.macro_use.prelude #[macro_use(macro_one, macro_two)] extern crate two_macros; diff --git a/tests/ui/macros/module-macro_use-arguments.rs b/tests/ui/macros/module-macro_use-arguments.rs index 121b492e25437..c459e190d8b99 100644 --- a/tests/ui/macros/module-macro_use-arguments.rs +++ b/tests/ui/macros/module-macro_use-arguments.rs @@ -1,3 +1,4 @@ +//@ reference: macro.decl.scope.macro_use.syntax #[macro_use(foo, bar)] //~ ERROR arguments to `macro_use` are not allowed here mod foo { } diff --git a/tests/ui/macros/module-macro_use-arguments.stderr b/tests/ui/macros/module-macro_use-arguments.stderr index 3ac645ad3a93f..8741103ea8dd4 100644 --- a/tests/ui/macros/module-macro_use-arguments.stderr +++ b/tests/ui/macros/module-macro_use-arguments.stderr @@ -1,5 +1,5 @@ error: arguments to `macro_use` are not allowed here - --> $DIR/module-macro_use-arguments.rs:1:1 + --> $DIR/module-macro_use-arguments.rs:2:1 | LL | #[macro_use(foo, bar)] | ^^^^^^^^^^^^^^^^^^^^^^