-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #57617 - mark-i-m:multiple-matcher-bindings, r=petroche…
…nkov Error on duplicate matcher bindings fix #57593 This should not be merged without a crater run and maybe an FCP. Discussion is ongoing at #57593. TODO: - [x] write tests - [x] crater run - [x] ~maybe need edition gating?~ not for 1 regression /centril r? @petrochenkov
- Loading branch information
Showing
10 changed files
with
171 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Test that duplicate matcher binding names are caught at declaration time, rather than at macro | ||
// invocation time. | ||
// | ||
// FIXME(mark-i-m): Update this when it becomes a hard error. | ||
|
||
// compile-pass | ||
|
||
#![allow(unused_macros)] | ||
|
||
macro_rules! foo1 { | ||
($a:ident, $a:ident) => {}; //~WARNING duplicate matcher binding | ||
($a:ident, $a:path) => {}; //~WARNING duplicate matcher binding | ||
} | ||
|
||
macro_rules! foo2 { | ||
($a:ident) => {}; // OK | ||
($a:path) => {}; // OK | ||
} | ||
|
||
macro_rules! foo3 { | ||
($a:ident, $($a:ident),*) => {}; //~WARNING duplicate matcher binding | ||
($($a:ident)+ # $($($a:path),+);*) => {}; //~WARNING duplicate matcher binding | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.