@@ -32,19 +32,21 @@ pub(crate) fn pinned_drop(_args: TokenStream, input: TokenStream) -> TokenStream
32
32
}
33
33
}
34
34
let idx = pinned_drop_idx. unwrap ( ) ;
35
- //inserting `::kernel::init::` in reverse order
36
- toks. insert ( idx, TokenTree :: Punct ( Punct :: new ( ':' , Spacing :: Alone ) ) ) ;
37
- toks. insert ( idx, TokenTree :: Punct ( Punct :: new ( ':' , Spacing :: Joint ) ) ) ;
38
- toks. insert ( idx, TokenTree :: Ident ( Ident :: new ( "init" , Span :: call_site ( ) ) ) ) ;
39
- toks. insert ( idx, TokenTree :: Punct ( Punct :: new ( ':' , Spacing :: Alone ) ) ) ;
40
- toks. insert ( idx, TokenTree :: Punct ( Punct :: new ( ':' , Spacing :: Joint ) ) ) ;
41
- toks. insert (
42
- idx,
43
- TokenTree :: Ident ( Ident :: new ( "kernel" , Span :: call_site ( ) ) ) ,
35
+ // fully qualify the `PinnedDrop`.
36
+ toks. splice (
37
+ idx..idx,
38
+ vec ! [
39
+ TokenTree :: Punct ( Punct :: new( ':' , Spacing :: Joint ) ) ,
40
+ TokenTree :: Punct ( Punct :: new( ':' , Spacing :: Alone ) ) ,
41
+ TokenTree :: Ident ( Ident :: new( "kernel" , Span :: call_site( ) ) ) ,
42
+ TokenTree :: Punct ( Punct :: new( ':' , Spacing :: Joint ) ) ,
43
+ TokenTree :: Punct ( Punct :: new( ':' , Spacing :: Alone ) ) ,
44
+ TokenTree :: Ident ( Ident :: new( "init" , Span :: call_site( ) ) ) ,
45
+ TokenTree :: Punct ( Punct :: new( ':' , Spacing :: Joint ) ) ,
46
+ TokenTree :: Punct ( Punct :: new( ':' , Spacing :: Alone ) ) ,
47
+ ] ,
44
48
) ;
45
- toks. insert ( idx, TokenTree :: Punct ( Punct :: new ( ':' , Spacing :: Alone ) ) ) ;
46
- toks. insert ( idx, TokenTree :: Punct ( Punct :: new ( ':' , Spacing :: Joint ) ) ) ;
47
- // take the {} body
49
+ // take the {} body.
48
50
if let Some ( TokenTree :: Group ( last) ) = toks. pop ( ) {
49
51
TokenStream :: from_iter ( vec ! [
50
52
TokenTree :: Punct ( Punct :: new( ':' , Spacing :: Joint ) ) ,
0 commit comments