Skip to content

Commit aa987c2

Browse files
committed
address comments
1 parent 2c66e15 commit aa987c2

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

compiler/rustc_expand/src/mbe/macro_rules.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ fn check_matcher_core(
969969
&OR_PATTERNS_BACK_COMPAT,
970970
span,
971971
ast::CRATE_NODE_ID,
972-
&*format!("the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro",),
972+
&*format!("the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro",),
973973
BuiltinLintDiagnostics::OrPatternsBackCompat(
974974
span, suggestion,
975975
),

src/test/ui/macros/macro-or-patterns-back-compat.fixed

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
#![feature(edition_macro_pats)]
55
#![deny(or_patterns_back_compat)]
66
#![allow(unused_macros)]
7-
macro_rules! foo { ($x:pat2015 | $y:pat) => {} } //~ ERROR the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
8-
macro_rules! bar { ($($x:pat2015)+ | $($y:pat)+) => {} } //~ ERROR the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
7+
macro_rules! foo { ($x:pat2015 | $y:pat) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
8+
macro_rules! bar { ($($x:pat2015)+ | $($y:pat)+) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
99
macro_rules! baz { ($x:pat2015 | $y:pat2015) => {} } // should be ok
1010
macro_rules! qux { ($x:pat2015 | $y:pat) => {} } // should be ok
11-
macro_rules! ogg { ($x:pat2015 | $y:pat2015) => {} } //~ ERROR the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
11+
macro_rules! ogg { ($x:pat2015 | $y:pat2015) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
1212
macro_rules! match_any {
13-
( $expr:expr , $( $( $pat:pat2015 )|+ => $expr_arm:expr ),+ ) => { //~ ERROR the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
13+
( $expr:expr , $( $( $pat:pat2015 )|+ => $expr_arm:expr ),+ ) => { //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
1414
match $expr {
1515
$(
1616
$( $pat => $expr_arm, )+

src/test/ui/macros/macro-or-patterns-back-compat.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
#![feature(edition_macro_pats)]
55
#![deny(or_patterns_back_compat)]
66
#![allow(unused_macros)]
7-
macro_rules! foo { ($x:pat | $y:pat) => {} } //~ ERROR the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
8-
macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } //~ ERROR the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
7+
macro_rules! foo { ($x:pat | $y:pat) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
8+
macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
99
macro_rules! baz { ($x:pat2015 | $y:pat2015) => {} } // should be ok
1010
macro_rules! qux { ($x:pat2015 | $y:pat) => {} } // should be ok
11-
macro_rules! ogg { ($x:pat | $y:pat2015) => {} } //~ ERROR the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
11+
macro_rules! ogg { ($x:pat | $y:pat2015) => {} } //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
1212
macro_rules! match_any {
13-
( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { //~ ERROR the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
13+
( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { //~ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
1414
match $expr {
1515
$(
1616
$( $pat => $expr_arm, )+

src/test/ui/macros/macro-or-patterns-back-compat.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
1+
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
22
--> $DIR/macro-or-patterns-back-compat.rs:7:21
33
|
44
LL | macro_rules! foo { ($x:pat | $y:pat) => {} }
@@ -10,19 +10,19 @@ note: the lint level is defined here
1010
LL | #![deny(or_patterns_back_compat)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^
1212

13-
error: the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
13+
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
1414
--> $DIR/macro-or-patterns-back-compat.rs:8:23
1515
|
1616
LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} }
1717
| ^^^^^^ help: use pat2015 to preserve semantics: `$x:pat2015`
1818

19-
error: the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
19+
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
2020
--> $DIR/macro-or-patterns-back-compat.rs:11:21
2121
|
2222
LL | macro_rules! ogg { ($x:pat | $y:pat2015) => {} }
2323
| ^^^^^^ help: use pat2015 to preserve semantics: `$x:pat2015`
2424

25-
error: the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro
25+
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
2626
--> $DIR/macro-or-patterns-back-compat.rs:13:26
2727
|
2828
LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => {

0 commit comments

Comments
 (0)