Skip to content

Commit 5381b61

Browse files
authored
Unrolled build for #153482
Rollup merge of #153482 - DanielEScherzer:test-references-macros, r=ehuss tests/ui/macros: add annotations for reference rules
2 parents 9836b06 + 0548502 commit 5381b61

46 files changed

Lines changed: 180 additions & 145 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/ui/macros/expr_2021.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ check-pass
22
//@ edition: 2015
3+
//@ reference: macro.decl.meta.edition2024
34

45
// Ensures expr_2021 fragment specifier is accepted in old editions
56

tests/ui/macros/expr_2021_inline_const.edi2021.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: no rules expected keyword `const`
2-
--> $DIR/expr_2021_inline_const.rs:23:12
2+
--> $DIR/expr_2021_inline_const.rs:24:12
33
|
44
LL | macro_rules! m2021 {
55
| ------------------ when calling this macro
@@ -8,13 +8,13 @@ LL | m2021!(const { 1 });
88
| ^^^^^ no rules expected this token in macro call
99
|
1010
note: while trying to match meta-variable `$e:expr_2021`
11-
--> $DIR/expr_2021_inline_const.rs:7:6
11+
--> $DIR/expr_2021_inline_const.rs:8:6
1212
|
1313
LL | ($e:expr_2021) => {
1414
| ^^^^^^^^^^^^
1515

1616
error: no rules expected keyword `const`
17-
--> $DIR/expr_2021_inline_const.rs:24:12
17+
--> $DIR/expr_2021_inline_const.rs:25:12
1818
|
1919
LL | macro_rules! m2024 {
2020
| ------------------ when calling this macro
@@ -23,7 +23,7 @@ LL | m2024!(const { 1 });
2323
| ^^^^^ no rules expected this token in macro call
2424
|
2525
note: while trying to match meta-variable `$e:expr`
26-
--> $DIR/expr_2021_inline_const.rs:13:6
26+
--> $DIR/expr_2021_inline_const.rs:14:6
2727
|
2828
LL | ($e:expr) => {
2929
| ^^^^^^^

tests/ui/macros/expr_2021_inline_const.edi2024.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: no rules expected keyword `const`
2-
--> $DIR/expr_2021_inline_const.rs:23:12
2+
--> $DIR/expr_2021_inline_const.rs:24:12
33
|
44
LL | macro_rules! m2021 {
55
| ------------------ when calling this macro
@@ -8,7 +8,7 @@ LL | m2021!(const { 1 });
88
| ^^^^^ no rules expected this token in macro call
99
|
1010
note: while trying to match meta-variable `$e:expr_2021`
11-
--> $DIR/expr_2021_inline_const.rs:7:6
11+
--> $DIR/expr_2021_inline_const.rs:8:6
1212
|
1313
LL | ($e:expr_2021) => {
1414
| ^^^^^^^^^^^^

tests/ui/macros/expr_2021_inline_const.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: edi2021 edi2024
22
//@[edi2024] edition: 2024
33
//@[edi2021] edition: 2021
4+
//@ reference: macro.decl.meta.edition2024
45

56
// This test ensures that the inline const match only on edition 2024
67
macro_rules! m2021 {

tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: no rules expected reserved identifier `_`
2-
--> $DIR/expr_2024_underscore_expr.rs:19:12
2+
--> $DIR/expr_2024_underscore_expr.rs:20:12
33
|
44
LL | macro_rules! m2021 {
55
| ------------------ when calling this macro
@@ -8,13 +8,13 @@ LL | m2021!(_);
88
| ^ no rules expected this token in macro call
99
|
1010
note: while trying to match meta-variable `$e:expr_2021`
11-
--> $DIR/expr_2024_underscore_expr.rs:7:6
11+
--> $DIR/expr_2024_underscore_expr.rs:8:6
1212
|
1313
LL | ($e:expr_2021) => {
1414
| ^^^^^^^^^^^^
1515

1616
error: no rules expected reserved identifier `_`
17-
--> $DIR/expr_2024_underscore_expr.rs:20:12
17+
--> $DIR/expr_2024_underscore_expr.rs:21:12
1818
|
1919
LL | macro_rules! m2024 {
2020
| ------------------ when calling this macro
@@ -23,7 +23,7 @@ LL | m2024!(_);
2323
| ^ no rules expected this token in macro call
2424
|
2525
note: while trying to match meta-variable `$e:expr`
26-
--> $DIR/expr_2024_underscore_expr.rs:13:6
26+
--> $DIR/expr_2024_underscore_expr.rs:14:6
2727
|
2828
LL | ($e:expr) => {
2929
| ^^^^^^^

tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: no rules expected reserved identifier `_`
2-
--> $DIR/expr_2024_underscore_expr.rs:19:12
2+
--> $DIR/expr_2024_underscore_expr.rs:20:12
33
|
44
LL | macro_rules! m2021 {
55
| ------------------ when calling this macro
@@ -8,7 +8,7 @@ LL | m2021!(_);
88
| ^ no rules expected this token in macro call
99
|
1010
note: while trying to match meta-variable `$e:expr_2021`
11-
--> $DIR/expr_2024_underscore_expr.rs:7:6
11+
--> $DIR/expr_2024_underscore_expr.rs:8:6
1212
|
1313
LL | ($e:expr_2021) => {
1414
| ^^^^^^^^^^^^

tests/ui/macros/expr_2024_underscore_expr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: edi2021 edi2024
22
//@[edi2024] edition: 2024
33
//@[edi2021] edition: 2021
4+
//@ reference: macro.decl.meta.edition2024
45
// This test ensures that the `_` tok is considered an
56
// expression on edition 2024.
67
macro_rules! m2021 {

tests/ui/macros/local-ambiguity-multiple-parsing-options.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ reference: macro.decl.transcription.lookahead
12
fn main() {}
23

34
macro_rules! ambiguity {

tests/ui/macros/local-ambiguity-multiple-parsing-options.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: local ambiguity when calling macro `ambiguity`: multiple parsing options: built-in NTs ident ('i') or ident ('j').
2-
--> $DIR/local-ambiguity-multiple-parsing-options.rs:7:12
2+
--> $DIR/local-ambiguity-multiple-parsing-options.rs:8:12
33
|
44
LL | ambiguity!(error);
55
| ^^^^^
66

77
error: local ambiguity when calling macro `ambiguity`: multiple parsing options: built-in NTs ident ('i') or ident ('j').
8-
--> $DIR/local-ambiguity-multiple-parsing-options.rs:8:12
8+
--> $DIR/local-ambiguity-multiple-parsing-options.rs:9:12
99
|
1010
LL | ambiguity!(error);
1111
| ^^^^^

tests/ui/macros/macro-error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ reference: macro.decl.syntax
12
macro_rules! foo {
23
($a:expr) => a; //~ ERROR macro rhs must be delimited
34
}

0 commit comments

Comments
 (0)