From 0762aad7f5734101663bb423032a5563624af07c Mon Sep 17 00:00:00 2001 From: Joe C Date: Thu, 18 Apr 2024 09:26:04 -0500 Subject: [PATCH] program error: use unambigious globs (#6590) --- Cargo.lock | 22 +++++++++---------- libraries/program-error/Cargo.toml | 4 ++-- libraries/program-error/derive/Cargo.toml | 2 +- .../program-error/derive/src/macro_impl.rs | 14 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9917d9c2856..38cc53ddedd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7015,7 +7015,7 @@ dependencies = [ "solana-program", "solana-program-test", "solana-sdk", - "spl-program-error 0.4.0", + "spl-program-error 0.4.1", ] [[package]] @@ -7263,7 +7263,7 @@ dependencies = [ "serde_json", "solana-program", "solana-zk-token-sdk", - "spl-program-error 0.4.0", + "spl-program-error 0.4.1", ] [[package]] @@ -7281,7 +7281,7 @@ dependencies = [ [[package]] name = "spl-program-error" -version = "0.4.0" +version = "0.4.1" dependencies = [ "lazy_static", "num-derive 0.4.2", @@ -7289,7 +7289,7 @@ dependencies = [ "serial_test", "solana-program", "solana-sdk", - "spl-program-error-derive 0.4.0", + "spl-program-error-derive 0.4.1", "thiserror", ] @@ -7307,7 +7307,7 @@ dependencies = [ [[package]] name = "spl-program-error-derive" -version = "0.4.0" +version = "0.4.1" dependencies = [ "proc-macro2", "quote", @@ -7476,7 +7476,7 @@ dependencies = [ "solana-sdk", "spl-discriminator 0.2.2", "spl-pod 0.2.2", - "spl-program-error 0.4.0", + "spl-program-error 0.4.1", "spl-type-length-value 0.4.3", ] @@ -7665,7 +7665,7 @@ dependencies = [ "solana-sdk", "spl-discriminator 0.2.2", "spl-pod 0.2.2", - "spl-program-error 0.4.0", + "spl-program-error 0.4.1", "spl-token-2022 3.0.2", "spl-token-client", "spl-token-group-example", @@ -7711,7 +7711,7 @@ dependencies = [ "solana-program", "spl-discriminator 0.2.2", "spl-pod 0.2.2", - "spl-program-error 0.4.0", + "spl-program-error 0.4.1", "spl-type-length-value 0.4.3", ] @@ -7787,7 +7787,7 @@ dependencies = [ "solana-program", "spl-discriminator 0.2.2", "spl-pod 0.2.2", - "spl-program-error 0.4.0", + "spl-program-error 0.4.1", "spl-type-length-value 0.4.3", ] @@ -7939,7 +7939,7 @@ dependencies = [ "solana-program", "spl-discriminator 0.2.2", "spl-pod 0.2.2", - "spl-program-error 0.4.0", + "spl-program-error 0.4.1", "spl-tlv-account-resolution 0.6.3", "spl-type-length-value 0.4.3", "tokio", @@ -7966,7 +7966,7 @@ dependencies = [ "solana-program", "spl-discriminator 0.2.2", "spl-pod 0.2.2", - "spl-program-error 0.4.0", + "spl-program-error 0.4.1", "spl-type-length-value-derive", ] diff --git a/libraries/program-error/Cargo.toml b/libraries/program-error/Cargo.toml index 86da6862db5..61925a4274f 100644 --- a/libraries/program-error/Cargo.toml +++ b/libraries/program-error/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-program-error" -version = "0.4.0" +version = "0.4.1" description = "Library for Solana Program error attributes and derive macro for creating them" authors = ["Solana Labs Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" @@ -11,7 +11,7 @@ edition = "2021" num-derive = "0.4" num-traits = "0.2" solana-program = ">=1.18.2,<=2" -spl-program-error-derive = { version = "0.4.0", path = "./derive" } +spl-program-error-derive = { version = "0.4.1", path = "./derive" } thiserror = "1.0" [dev-dependencies] diff --git a/libraries/program-error/derive/Cargo.toml b/libraries/program-error/derive/Cargo.toml index 4ac53fda277..74aec23ba4a 100644 --- a/libraries/program-error/derive/Cargo.toml +++ b/libraries/program-error/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spl-program-error-derive" -version = "0.4.0" +version = "0.4.1" description = "Proc-Macro Library for Solana Program error attributes and derive macro" authors = ["Solana Labs Maintainers "] repository = "https://github.com/solana-labs/solana-program-library" 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 {