File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed
Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change 11//@ edition: 2021
2-
3- #![ feature( macro_metavar_expr) ]
4-
52#[ macro_export]
63macro_rules! make_matcher {
7- ( $name: ident, $fragment_type: ident) => {
4+ ( $name: ident, $fragment_type: ident, $d : tt ) => {
85 #[ macro_export]
96 macro_rules! $name {
10- ( $$ _: $fragment_type) => { true } ;
11- ( $$ ( $$_ : tt ) * ) => { false } ;
7+ ( $d _: $fragment_type) => { true } ;
8+ ( const { 0 } ) => { false } ;
129 }
13- }
10+ } ;
1411}
15-
16- make_matcher ! ( is_expr_from_2021, expr) ;
12+ make_matcher ! ( is_expr_from_2021, expr, $) ;
Original file line number Diff line number Diff line change 22//@ aux-build: metavar_2021.rs
33//@ run-pass
44
5- // This test captures the behavior of macro-generating-macros with fragment specifiers across edition b
5+ // This test captures the behavior of macro-generating-macros with fragment
6+ // specifiers across edition boundaries.
67
78#![ feature( expr_fragment_specifier_2024) ]
89#![ feature( macro_metavar_expr) ]
@@ -12,7 +13,7 @@ extern crate metavar_2021;
1213
1314use metavar_2021:: { is_expr_from_2021, make_matcher} ;
1415
15- make_matcher ! ( is_expr_from_2024, expr) ;
16+ make_matcher ! ( is_expr_from_2024, expr, $ ) ;
1617
1718fn main ( ) {
1819 let from_2021 = is_expr_from_2021 ! ( const { 0 } ) ;
@@ -21,9 +22,7 @@ fn main() {
2122 dbg ! ( from_2024) ;
2223
2324 // These capture the current, empirically determined behavior.
24- //
25- // It's not clear whether this is the desired behavior, but that's a
26- // question we can deal with when stabilizing macro_metavar_expr.
25+ // It's not clear whether this is the desired behavior.
2726 assert ! ( !from_2021) ;
2827 assert ! ( !from_2024) ;
2928}
You can’t perform that action at this time.
0 commit comments