File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change
1
+ use proc_macro:: { Delimiter , Group , TokenStream , TokenTree } ;
2
+
3
+ pub fn fix ( ts : TokenStream ) -> TokenStream {
4
+ ts. into_iter ( )
5
+ . map ( |t| match t {
6
+ TokenTree :: Group ( g) => {
7
+ let mut fixed = Group :: new (
8
+ match g. delimiter ( ) {
9
+ Delimiter :: None => Delimiter :: Parenthesis ,
10
+ d => d,
11
+ } ,
12
+ fix ( g. stream ( ) ) ,
13
+ ) ;
14
+ fixed. set_span ( g. span ( ) ) ;
15
+ TokenTree :: Group ( fixed)
16
+ }
17
+ t => t,
18
+ } )
19
+ . collect ( )
20
+ }
Original file line number Diff line number Diff line change @@ -14,15 +14,16 @@ type FormatArgs = Punctuated<syn::Expr, syn::token::Comma>;
14
14
#[ doc( hidden) ]
15
15
#[ proc_macro]
16
16
pub fn check_impl ( tokens : proc_macro:: TokenStream ) -> proc_macro:: TokenStream {
17
- check_or_assert_impl ( syn:: parse_macro_input!( tokens) ) . into ( )
17
+ hygiene_bug :: fix ( check_or_assert_impl ( syn:: parse_macro_input!( tokens) ) . into ( ) )
18
18
}
19
19
20
+ mod hygiene_bug;
20
21
mod let_assert;
21
22
22
23
#[ doc( hidden) ]
23
24
#[ proc_macro]
24
25
pub fn let_assert_impl ( tokens : proc_macro:: TokenStream ) -> proc_macro:: TokenStream {
25
- let_assert:: let_assert_impl ( syn:: parse_macro_input!( tokens) ) . into ( )
26
+ hygiene_bug :: fix ( let_assert:: let_assert_impl ( syn:: parse_macro_input!( tokens) ) . into ( ) )
26
27
}
27
28
28
29
/// Real implementation for assert!() and check!().
You can’t perform that action at this time.
0 commit comments