File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ macro_rules! foo { () => {
1717 let _ = bar!( ) ;
1818} }
1919
20- macro_rules! bar { // test issue #31856
20+ macro_rules! m { // test issue #31856
2121 ( $n: ident) => (
2222 let a = 1 ;
2323 let $n = a;
Original file line number Diff line number Diff line change @@ -22,23 +22,23 @@ fn f() {
2222
2323fn g ( ) {
2424 let x = 0 ;
25- macro_rules! m { ( $x: ident) => {
26- macro_rules! m2 { ( ) => { ( $x, x) } }
25+ macro_rules! m { ( $m1 : ident , $m2 : ident , $ x: ident) => {
26+ macro_rules! $m1 { ( ) => { ( $x, x) } }
2727 let x = 1 ;
28- macro_rules! m3 { ( ) => { ( $x, x) } }
28+ macro_rules! $m2 { ( ) => { ( $x, x) } }
2929 } }
3030
3131 let x = 2 ;
32- m ! ( x) ;
32+ m ! ( m2 , m3 , x) ;
3333
3434 let x = 3 ;
3535 assert_eq ! ( m2!( ) , ( 2 , 0 ) ) ;
3636 assert_eq ! ( m3!( ) , ( 2 , 1 ) ) ;
3737
3838 let x = 4 ;
39- m ! ( x) ;
40- assert_eq ! ( m2 !( ) , ( 4 , 0 ) ) ;
41- assert_eq ! ( m3 !( ) , ( 4 , 1 ) ) ;
39+ m ! ( m4 , m5 , x) ;
40+ assert_eq ! ( m4 !( ) , ( 4 , 0 ) ) ;
41+ assert_eq ! ( m5 !( ) , ( 4 , 1 ) ) ;
4242}
4343
4444mod foo {
You can’t perform that action at this time.
0 commit comments