mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
address comments
This commit is contained in:
parent
2c66e15468
commit
aa987c2f57
@ -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,
|
||||
),
|
||||
|
@ -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, )+
|
||||
|
@ -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, )+
|
||||
|
@ -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 ),+ ) => {
|
||||
|
Loading…
Reference in New Issue
Block a user