diff options
| author | hi-rustin <rustin.liu@gmail.com> | 2021-04-02 08:08:02 +0800 |
|---|---|---|
| committer | hi-rustin <rustin.liu@gmail.com> | 2021-04-02 08:08:02 +0800 |
| commit | aa987c2f57d5604d5dd3a7db5031f021dc8418a6 (patch) | |
| tree | 42cf4f6f693860202dc5e9ba5259bf893d104374 | |
| parent | 2c66e154681087f8c1da6809e41e23c1e0962d30 (diff) | |
| download | rust-aa987c2f57d5604d5dd3a7db5031f021dc8418a6.tar.gz rust-aa987c2f57d5604d5dd3a7db5031f021dc8418a6.zip | |
address comments
4 files changed, 13 insertions, 13 deletions
diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index a85ed18055b..bc45c57596e 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -969,7 +969,7 @@ fn check_matcher_core( &OR_PATTERNS_BACK_COMPAT, span, ast::CRATE_NODE_ID, - &*format!("the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro",), + &*format!("the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro",), BuiltinLintDiagnostics::OrPatternsBackCompat( span, suggestion, ), diff --git a/src/test/ui/macros/macro-or-patterns-back-compat.fixed b/src/test/ui/macros/macro-or-patterns-back-compat.fixed index 60ec0f7430d..4e8b057457c 100644 --- a/src/test/ui/macros/macro-or-patterns-back-compat.fixed +++ b/src/test/ui/macros/macro-or-patterns-back-compat.fixed @@ -4,13 +4,13 @@ #![feature(edition_macro_pats)] #![deny(or_patterns_back_compat)] #![allow(unused_macros)] -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 -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 +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 +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 macro_rules! baz { ($x:pat2015 | $y:pat2015) => {} } // should be ok macro_rules! qux { ($x:pat2015 | $y:pat) => {} } // should be ok -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 +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 macro_rules! match_any { - ( $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 + ( $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 match $expr { $( $( $pat => $expr_arm, )+ diff --git a/src/test/ui/macros/macro-or-patterns-back-compat.rs b/src/test/ui/macros/macro-or-patterns-back-compat.rs index dc9e8595ca2..023abae36d0 100644 --- a/src/test/ui/macros/macro-or-patterns-back-compat.rs +++ b/src/test/ui/macros/macro-or-patterns-back-compat.rs @@ -4,13 +4,13 @@ #![feature(edition_macro_pats)] #![deny(or_patterns_back_compat)] #![allow(unused_macros)] -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 -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 +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 +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 macro_rules! baz { ($x:pat2015 | $y:pat2015) => {} } // should be ok macro_rules! qux { ($x:pat2015 | $y:pat) => {} } // should be ok -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 +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 macro_rules! match_any { - ( $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 + ( $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 match $expr { $( $( $pat => $expr_arm, )+ diff --git a/src/test/ui/macros/macro-or-patterns-back-compat.stderr b/src/test/ui/macros/macro-or-patterns-back-compat.stderr index 630a11c1734..29bbd696033 100644 --- a/src/test/ui/macros/macro-or-patterns-back-compat.stderr +++ b/src/test/ui/macros/macro-or-patterns-back-compat.stderr @@ -1,4 +1,4 @@ -error: the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro +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:7:21 | LL | macro_rules! foo { ($x:pat | $y:pat) => {} } @@ -10,19 +10,19 @@ note: the lint level is defined here LL | #![deny(or_patterns_back_compat)] | ^^^^^^^^^^^^^^^^^^^^^^^ -error: the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro +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:8:23 | LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } | ^^^^^^ help: use pat2015 to preserve semantics: `$x:pat2015` -error: the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro +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 | LL | macro_rules! ogg { ($x:pat | $y:pat2015) => {} } | ^^^^^^ help: use pat2015 to preserve semantics: `$x:pat2015` -error: the meaning of the pat fragment specific is changing in Rust 2021, which may affect this macro +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:13:26 | LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { |
