update test
This commit is contained in:
parent
802b256283
commit
c25d6b8344
2 changed files with 31 additions and 27 deletions
|
@ -1,11 +1,15 @@
|
||||||
// Test that duplicate matcher binding names are caught at declaration time, rather than at macro
|
// Test that duplicate matcher binding names are caught at declaration time, rather than at macro
|
||||||
// invocation time.
|
// invocation time.
|
||||||
|
//
|
||||||
|
// FIXME(mark-i-m): Update this when it becomes a hard error.
|
||||||
|
|
||||||
|
// compile-pass
|
||||||
|
|
||||||
#![allow(unused_macros)]
|
#![allow(unused_macros)]
|
||||||
|
|
||||||
macro_rules! foo1 {
|
macro_rules! foo1 {
|
||||||
($a:ident, $a:ident) => {}; //~WARN duplicate matcher binding
|
($a:ident, $a:ident) => {}; //~WARNING duplicate matcher binding
|
||||||
($a:ident, $a:path) => {}; //~WARN duplicate matcher binding
|
($a:ident, $a:path) => {}; //~WARNING duplicate matcher binding
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! foo2 {
|
macro_rules! foo2 {
|
||||||
|
@ -14,8 +18,8 @@ macro_rules! foo2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! foo3 {
|
macro_rules! foo3 {
|
||||||
($a:ident, $($a:ident),*) => {}; //~WARN duplicate matcher binding
|
($a:ident, $($a:ident),*) => {}; //~WARNING duplicate matcher binding
|
||||||
($($a:ident)+ # $($($a:path),+);*) => {}; //~WARN duplicate matcher binding
|
($($a:ident)+ # $($($a:path),+);*) => {}; //~WARNING duplicate matcher binding
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
warning: duplicate matcher binding
|
warning: duplicate matcher binding
|
||||||
--> src/test/ui/macros/macro-multiple-matcher-bindings.rs:7:6
|
--> $DIR/macro-multiple-matcher-bindings.rs:11:6
|
||||||
|
|
|
||||||
7 | ($a:ident, $a:ident) => {}; //~WARN duplicate matcher binding
|
|
||||||
| ^^^^^^^^ ^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: #[warn(duplicate_matcher_binding_name)] on by default
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #57593 <https://github.com/rust-lang/rust/issues/57593>
|
|
||||||
|
|
||||||
warning: duplicate matcher binding
|
|
||||||
--> src/test/ui/macros/macro-multiple-matcher-bindings.rs:8:6
|
|
||||||
|
|
|
||||||
8 | ($a:ident, $a:path) => {}; //~WARN duplicate matcher binding
|
|
||||||
| ^^^^^^^^ ^^^^^^^
|
|
||||||
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #57593 <https://github.com/rust-lang/rust/issues/57593>
|
|
||||||
|
|
||||||
warning: duplicate matcher binding
|
|
||||||
--> src/test/ui/macros/macro-multiple-matcher-bindings.rs:17:6
|
|
||||||
|
|
|
|
||||||
LL | ($a:ident, $($a:ident),*) => {}; //~WARN duplicate matcher binding
|
LL | ($a:ident, $a:ident) => {}; //~WARNING duplicate matcher binding
|
||||||
|
| ^^^^^^^^ ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: #[warn(duplicate_matcher_binding_name)] on by default
|
||||||
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||||
|
= note: for more information, see issue #57593 <https://github.com/rust-lang/rust/issues/57593>
|
||||||
|
|
||||||
|
warning: duplicate matcher binding
|
||||||
|
--> $DIR/macro-multiple-matcher-bindings.rs:12:6
|
||||||
|
|
|
||||||
|
LL | ($a:ident, $a:path) => {}; //~WARNING duplicate matcher binding
|
||||||
|
| ^^^^^^^^ ^^^^^^^
|
||||||
|
|
|
||||||
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||||
|
= note: for more information, see issue #57593 <https://github.com/rust-lang/rust/issues/57593>
|
||||||
|
|
||||||
|
warning: duplicate matcher binding
|
||||||
|
--> $DIR/macro-multiple-matcher-bindings.rs:21:6
|
||||||
|
|
|
||||||
|
LL | ($a:ident, $($a:ident),*) => {}; //~WARNING duplicate matcher binding
|
||||||
| ^^^^^^^^ ^^^^^^^^
|
| ^^^^^^^^ ^^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||||
= note: for more information, see issue #57593 <https://github.com/rust-lang/rust/issues/57593>
|
= note: for more information, see issue #57593 <https://github.com/rust-lang/rust/issues/57593>
|
||||||
|
|
||||||
warning: duplicate matcher binding
|
warning: duplicate matcher binding
|
||||||
--> src/test/ui/macros/macro-multiple-matcher-bindings.rs:18:8
|
--> $DIR/macro-multiple-matcher-bindings.rs:22:8
|
||||||
|
|
|
|
||||||
LL | ($($a:ident)+ # $($($a:path),+);*) => {}; //~WARN duplicate matcher binding
|
LL | ($($a:ident)+ # $($($a:path),+);*) => {}; //~WARNING duplicate matcher binding
|
||||||
| ^^^^^^^^ ^^^^^^^
|
| ^^^^^^^^ ^^^^^^^
|
||||||
|
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue