11use crate :: codegen:: program:: common:: * ;
22use crate :: program_codegen:: idl:: idl_accounts_and_functions;
33use crate :: Program ;
4- use quote:: { quote_spanned, ToTokens } ;
4+ use quote:: { quote , quote_spanned, ToTokens } ;
55use syn:: spanned:: Spanned ;
66
77// Generate non-inlined wrappers for each instruction handler, since Solana's
@@ -12,9 +12,8 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream {
1212 // A constant token stream that stores the accounts and functions, required to live
1313 // inside the target program in order to get the program ID.
1414 let idl_accounts_and_functions = idl_accounts_and_functions ( ) ;
15- let program_span = program. program_mod . span ( ) ;
1615 let non_inlined_idl: proc_macro2:: TokenStream = {
17- quote_spanned ! { program_span =>
16+ quote ! {
1817 // Entry for all IDL related instructions. Use the "no-idl" feature
1918 // to eliminate this code, for example, if one wants to make the
2019 // IDL no longer mutable or if one doesn't want to store the IDL
@@ -169,7 +168,7 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream {
169168 } )
170169 . collect ( ) ;
171170
172- quote_spanned ! { program_span =>
171+ quote ! {
173172 /// Create a private module to not clutter the program's namespace.
174173 /// Defines an entrypoint for each individual instruction handler
175174 /// wrapper.
@@ -201,9 +200,8 @@ fn generate_event_cpi_mod() -> proc_macro2::TokenStream {
201200 {
202201 let authority = crate :: parser:: accounts:: event_cpi:: EventAuthority :: get ( ) ;
203202 let authority_name = authority. name ;
204- let span = proc_macro2:: Span :: call_site ( ) ;
205203
206- quote_spanned ! { span =>
204+ quote ! {
207205 /// __events mod defines handler for self-cpi based event logging
208206 pub mod __events {
209207 use super :: * ;
@@ -237,7 +235,6 @@ fn generate_event_cpi_mod() -> proc_macro2::TokenStream {
237235 }
238236 #[ cfg( not( feature = "event-cpi" ) ) ]
239237 {
240- let span = proc_macro2:: Span :: call_site ( ) ;
241- quote_spanned ! { span => }
238+ quote ! { }
242239 }
243240}
0 commit comments