From c3eaa18ec01c99ef7b05b539964d2848d7eb2bee Mon Sep 17 00:00:00 2001 From: Joe Caulfield Date: Wed, 17 Apr 2024 11:14:50 -0500 Subject: [PATCH] program error: use unambigious globs --- libraries/program-error/derive/src/macro_impl.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/program-error/derive/src/macro_impl.rs b/libraries/program-error/derive/src/macro_impl.rs index f323e2ba786..21e89ee3441 100644 --- a/libraries/program-error/derive/src/macro_impl.rs +++ b/libraries/program-error/derive/src/macro_impl.rs @@ -50,9 +50,9 @@ impl MacroType { /// implements `From for solana_program::program_error::ProgramError` pub fn into_program_error(ident: &Ident) -> proc_macro2::TokenStream { quote! { - impl From<#ident> for solana_program::program_error::ProgramError { + impl From<#ident> for ::solana_program::program_error::ProgramError { fn from(e: #ident) -> Self { - solana_program::program_error::ProgramError::Custom(e as u32) + ::solana_program::program_error::ProgramError::Custom(e as u32) } } } @@ -61,7 +61,7 @@ pub fn into_program_error(ident: &Ident) -> proc_macro2::TokenStream { /// Builds the implementation of `solana_program::decode_error::DecodeError` pub fn decode_error(ident: &Ident) -> proc_macro2::TokenStream { quote! { - impl solana_program::decode_error::DecodeError for #ident { + impl ::solana_program::decode_error::DecodeError for #ident { fn type_of() -> &'static str { stringify!(#ident) } @@ -81,18 +81,18 @@ pub fn print_program_error( .unwrap_or_else(|| String::from("Unknown custom program error")); quote! { #ident::#variant_ident => { - solana_program::msg!(#error_msg) + ::solana_program::msg!(#error_msg) } } }); quote! { - impl solana_program::program_error::PrintProgramError for #ident { + impl ::solana_program::program_error::PrintProgramError for #ident { fn print(&self) where E: 'static + std::error::Error - + solana_program::decode_error::DecodeError - + solana_program::program_error::PrintProgramError + + ::solana_program::decode_error::DecodeError + + ::solana_program::program_error::PrintProgramError + num_traits::FromPrimitive, { match self {