22
33//! Crate for all kernel procedural macros.
44
5- #[ macro_use]
6- mod quote;
75mod concat_idents;
86mod helpers;
97mod module;
@@ -76,7 +74,7 @@ use proc_macro::TokenStream;
7674/// - `alias`: byte array of alias name of the kernel module.
7775#[ proc_macro]
7876pub fn module ( ts : TokenStream ) -> TokenStream {
79- module:: module ( ts)
77+ module:: module ( ts. into ( ) ) . into ( )
8078}
8179
8280/// Declares or implements a vtable trait.
@@ -151,7 +149,7 @@ pub fn module(ts: TokenStream) -> TokenStream {
151149/// [`kernel::error::VTABLE_DEFAULT_ERROR`]: ../kernel/error/constant.VTABLE_DEFAULT_ERROR.html
152150#[ proc_macro_attribute]
153151pub fn vtable ( attr : TokenStream , ts : TokenStream ) -> TokenStream {
154- vtable:: vtable ( attr, ts)
152+ vtable:: vtable ( attr. into ( ) , ts. into ( ) ) . into ( )
155153}
156154
157155/// Concatenate two identifiers.
@@ -194,7 +192,7 @@ pub fn vtable(attr: TokenStream, ts: TokenStream) -> TokenStream {
194192/// ```
195193#[ proc_macro]
196194pub fn concat_idents ( ts : TokenStream ) -> TokenStream {
197- concat_idents:: concat_idents ( ts)
195+ concat_idents:: concat_idents ( ts. into ( ) ) . into ( )
198196}
199197
200198/// Used to specify the pinning information of the fields of a struct.
@@ -243,7 +241,7 @@ pub fn concat_idents(ts: TokenStream) -> TokenStream {
243241// ^ cannot use direct link, since `kernel` is not a dependency of `macros`.
244242#[ proc_macro_attribute]
245243pub fn pin_data ( inner : TokenStream , item : TokenStream ) -> TokenStream {
246- pin_data:: pin_data ( inner, item)
244+ pin_data:: pin_data ( inner. into ( ) , item. into ( ) ) . into ( )
247245}
248246
249247/// Used to implement `PinnedDrop` safely.
@@ -270,7 +268,7 @@ pub fn pin_data(inner: TokenStream, item: TokenStream) -> TokenStream {
270268/// ```
271269#[ proc_macro_attribute]
272270pub fn pinned_drop ( args : TokenStream , input : TokenStream ) -> TokenStream {
273- pinned_drop:: pinned_drop ( args, input)
271+ pinned_drop:: pinned_drop ( args. into ( ) , input. into ( ) ) . into ( )
274272}
275273
276274/// Paste identifiers together.
@@ -382,9 +380,13 @@ pub fn pinned_drop(args: TokenStream, input: TokenStream) -> TokenStream {
382380/// [`paste`]: https://docs.rs/paste/
383381#[ proc_macro]
384382pub fn paste ( input : TokenStream ) -> TokenStream {
383+ let input: proc_macro2:: TokenStream = input. into ( ) ;
385384 let mut tokens = input. into_iter ( ) . collect ( ) ;
386385 paste:: expand ( & mut tokens) ;
387- tokens. into_iter ( ) . collect ( )
386+ tokens
387+ . into_iter ( )
388+ . collect :: < proc_macro2:: TokenStream > ( )
389+ . into ( )
388390}
389391
390392/// Derives the [`Zeroable`] trait for the given struct.
@@ -403,5 +405,5 @@ pub fn paste(input: TokenStream) -> TokenStream {
403405/// ```
404406#[ proc_macro_derive( Zeroable ) ]
405407pub fn derive_zeroable ( input : TokenStream ) -> TokenStream {
406- zeroable:: derive ( input)
408+ zeroable:: derive ( input. into ( ) ) . into ( )
407409}
0 commit comments