Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/ui/macros/expr_2021.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ check-pass
//@ edition: 2015
//@ reference: macro.decl.meta.edition2024

// Ensures expr_2021 fragment specifier is accepted in old editions

Expand Down
8 changes: 4 additions & 4 deletions tests/ui/macros/expr_2021_inline_const.edi2021.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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) => {
| ^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/macros/expr_2021_inline_const.edi2024.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) => {
| ^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/macros/expr_2021_inline_const.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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) => {
| ^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) => {
| ^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/macros/expr_2024_underscore_expr.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ reference: macro.decl.transcription.lookahead
fn main() {}

macro_rules! ambiguity {
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
| ^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/macros/macro-error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ reference: macro.decl.syntax
macro_rules! foo {
($a:expr) => a; //~ ERROR macro rhs must be delimited
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/macros/macro-error.stderr
Original file line number Diff line number Diff line change
@@ -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) = ();
| ^^^^^^^^^^^
Expand Down
5 changes: 5 additions & 0 deletions tests/ui/macros/macro-follow-rpass.rs
Original file line number Diff line number Diff line change
@@ -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).

Expand Down
4 changes: 3 additions & 1 deletion tests/ui/macros/macro-follow.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Loading
Loading