From 961f926eb34cf03d975ac4ad7b1910ab6b08cbf5 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:12:29 +0100 Subject: [PATCH] Replace thiserror-no-std with thiserror 2 --- Cargo.lock | 58 +++++++++---------- Cargo.toml | 2 +- cairo-vm-cli/Cargo.toml | 2 +- cairo-vm-tracer/Cargo.toml | 2 +- .../src/error/trace_data_errors.rs | 2 +- cairo1-run/Cargo.toml | 2 +- vm/Cargo.toml | 4 +- vm/src/air_public_input.rs | 2 +- vm/src/cairo_run.rs | 2 +- vm/src/program_hash.rs | 4 +- vm/src/types/errors/math_errors.rs | 2 +- vm/src/types/errors/program_errors.rs | 2 +- vm/src/vm/errors/cairo_pie_errors.rs | 2 +- vm/src/vm/errors/cairo_run_errors.rs | 2 +- vm/src/vm/errors/exec_scope_errors.rs | 2 +- vm/src/vm/errors/hint_errors.rs | 2 +- vm/src/vm/errors/memory_errors.rs | 2 +- vm/src/vm/errors/runner_errors.rs | 2 +- vm/src/vm/errors/trace_errors.rs | 2 +- vm/src/vm/errors/vm_errors.rs | 2 +- vm/src/vm/errors/vm_exception.rs | 2 +- 21 files changed, 51 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a97304a19d..5c844e4d8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -481,7 +481,7 @@ dependencies = [ "rust-analyzer-salsa", "semver", "smol_str", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -565,7 +565,7 @@ dependencies = [ "itertools 0.12.1", "rust-analyzer-salsa", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -658,7 +658,7 @@ dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", "serde", - "thiserror", + "thiserror 1.0.69", "toml", ] @@ -713,7 +713,7 @@ dependencies = [ "sha3", "smol_str", "starknet-types-core", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -729,7 +729,7 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -745,7 +745,7 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -790,7 +790,7 @@ dependencies = [ "num-bigint", "num-traits", "starknet-types-core", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -830,7 +830,7 @@ dependencies = [ "serde_json", "smol_str", "starknet-types-core", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -853,7 +853,7 @@ dependencies = [ "sha3", "smol_str", "starknet-types-core", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -950,7 +950,7 @@ dependencies = [ "sha3", "starknet-crypto", "starknet-types-core", - "thiserror-no-std", + "thiserror 2.0.11", "wasm-bindgen", "wasm-bindgen-test", "zip", @@ -968,7 +968,7 @@ dependencies = [ "mimalloc", "nom", "rstest", - "thiserror", + "thiserror 2.0.11", ] [[package]] @@ -982,7 +982,7 @@ dependencies = [ "num-bigint", "num-traits", "serde", - "thiserror-no-std", + "thiserror 2.0.11", "tokio", "tower", "tower-http", @@ -1013,7 +1013,7 @@ dependencies = [ "num-traits", "rstest", "serde_json", - "thiserror", + "thiserror 2.0.11", ] [[package]] @@ -2604,7 +2604,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3137,7 +3137,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] @@ -3152,23 +3161,14 @@ dependencies = [ ] [[package]] -name = "thiserror-impl-no-std" -version = "2.0.2" +name = "thiserror-impl" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e6318948b519ba6dc2b442a6d0b904ebfb8d411a3ad3e07843615a72249758" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", -] - -[[package]] -name = "thiserror-no-std" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ad459d94dd517257cc96add8a43190ee620011bb6e6cdc82dafd97dfafafea" -dependencies = [ - "thiserror-impl-no-std", + "syn 2.0.91", ] [[package]] @@ -3424,7 +3424,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c878a167baa8afd137494101a688ef8c67125089ff2249284bd2b5f9bfedb815" dependencies = [ - "thiserror", + "thiserror 1.0.69", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2a9121eea1..87697afd7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,7 @@ generic-array = { version = "0.14.7", default-features = false } keccak = { version = "0.1.2", default-features = false } hashbrown = { version = "0.15.2", features = ["serde"] } anyhow = { version = "1.0.94", default-features = false } -thiserror-no-std = { version = "2.0.2", default-features = false } +thiserror = { version = "2", default-features = false } bitvec = { version = "1", default-features = false, features = ["alloc"] } diff --git a/cairo-vm-cli/Cargo.toml b/cairo-vm-cli/Cargo.toml index 15869fe90f..47e7118a9d 100644 --- a/cairo-vm-cli/Cargo.toml +++ b/cairo-vm-cli/Cargo.toml @@ -13,7 +13,7 @@ cairo-vm-tracer = { workspace = true, optional = true } clap = { version = "4.3.10", features = ["derive"] } mimalloc = { version = "0.1.37", default-features = false, optional = true } nom = "7" -thiserror = { version = "1.0.40" } +thiserror = { workspace = true, features = ["std"]} bincode.workspace = true [dev-dependencies] diff --git a/cairo-vm-tracer/Cargo.toml b/cairo-vm-tracer/Cargo.toml index e19f692542..5a55fb8ff7 100644 --- a/cairo-vm-tracer/Cargo.toml +++ b/cairo-vm-tracer/Cargo.toml @@ -13,7 +13,7 @@ alloc = [] [dependencies] cairo-vm = { workspace = true, features = ["test_utils"] } -thiserror-no-std = { workspace = true } +thiserror = { workspace = true, features = ["std"] } num-bigint = { workspace = true } num-traits = { workspace = true } axum = "0.6.18" diff --git a/cairo-vm-tracer/src/error/trace_data_errors.rs b/cairo-vm-tracer/src/error/trace_data_errors.rs index 7af3f540cf..a21def4eb9 100644 --- a/cairo-vm-tracer/src/error/trace_data_errors.rs +++ b/cairo-vm-tracer/src/error/trace_data_errors.rs @@ -1,5 +1,5 @@ use cairo_vm::vm::errors::{memory_errors::MemoryError, vm_errors::VirtualMachineError}; -use thiserror_no_std::Error; +use thiserror::Error; #[derive(Debug, Error)] pub enum TraceDataError { diff --git a/cairo1-run/Cargo.toml b/cairo1-run/Cargo.toml index e78ef041f9..a3bcb1be04 100644 --- a/cairo1-run/Cargo.toml +++ b/cairo1-run/Cargo.toml @@ -23,7 +23,7 @@ cairo-lang-utils.workspace = true cairo-lang-casm.workspace = true itertools = "0.11.0" clap = { version = "4.3.10", features = ["derive"] } -thiserror = { version = "1.0.40" } +thiserror = { workspace = true, features = ["std"] } bincode.workspace = true assert_matches = "1.5.0" rstest = "0.17.0" diff --git a/vm/Cargo.toml b/vm/Cargo.toml index a01a0ce2c0..25f1d83dbf 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -17,7 +17,7 @@ std = [ "starknet-types-core/std", "starknet-crypto/std", "dep:num-prime", - "thiserror-no-std/std", + "thiserror/std", "dep:zip", ] cairo-1-hints = [ @@ -57,7 +57,7 @@ generic-array = { workspace = true } keccak = { workspace = true } hashbrown = { workspace = true } anyhow = { workspace = true } -thiserror-no-std = { workspace = true } +thiserror = { workspace = true } starknet-types-core = { version = "0.1.2", default-features = false, features = ["serde", "curve", "num-traits", "hash"] } rust_decimal = { version = "1.35.0", default-features = false } diff --git a/vm/src/air_public_input.rs b/vm/src/air_public_input.rs index d4f39dfc80..4dddf121f9 100644 --- a/vm/src/air_public_input.rs +++ b/vm/src/air_public_input.rs @@ -1,6 +1,6 @@ use crate::Felt252; use serde::{Deserialize, Serialize}; -use thiserror_no_std::Error; +use thiserror::Error; use crate::{ stdlib::{ diff --git a/vm/src/cairo_run.rs b/vm/src/cairo_run.rs index 0e61856a3b..3ebb3d419f 100644 --- a/vm/src/cairo_run.rs +++ b/vm/src/cairo_run.rs @@ -16,7 +16,7 @@ use crate::{ use crate::Felt252; use bincode::enc::write::Writer; -use thiserror_no_std::Error; +use thiserror::Error; use crate::types::exec_scope::ExecutionScopes; #[cfg(feature = "test_utils")] diff --git a/vm/src/program_hash.rs b/vm/src/program_hash.rs index 2f31fe7d9f..cb100abeb3 100644 --- a/vm/src/program_hash.rs +++ b/vm/src/program_hash.rs @@ -9,13 +9,13 @@ use crate::vm::runners::cairo_pie::StrippedProgram; type HashFunction = fn(&Felt252, &Felt252) -> Felt252; -#[derive(thiserror_no_std::Error, Debug)] +#[derive(thiserror::Error, Debug)] pub enum HashChainError { #[error("Data array must contain at least one element.")] EmptyData, } -#[derive(thiserror_no_std::Error, Debug)] +#[derive(thiserror::Error, Debug)] pub enum ProgramHashError { #[error(transparent)] HashChain(#[from] HashChainError), diff --git a/vm/src/types/errors/math_errors.rs b/vm/src/types/errors/math_errors.rs index 2a12efe12a..00a8e96542 100644 --- a/vm/src/types/errors/math_errors.rs +++ b/vm/src/types/errors/math_errors.rs @@ -4,7 +4,7 @@ use crate::stdlib::boxed::Box; use crate::Felt252; use num_bigint::{BigInt, BigUint}; -use thiserror_no_std::Error; +use thiserror::Error; use crate::types::relocatable::{MaybeRelocatable, Relocatable}; diff --git a/vm/src/types/errors/program_errors.rs b/vm/src/types/errors/program_errors.rs index 77f62585e0..f362e5acfc 100644 --- a/vm/src/types/errors/program_errors.rs +++ b/vm/src/types/errors/program_errors.rs @@ -1,6 +1,6 @@ use crate::stdlib::prelude::*; use crate::utils::PRIME_STR; -use thiserror_no_std::Error; +use thiserror::Error; #[derive(Debug, Error)] pub enum ProgramError { diff --git a/vm/src/vm/errors/cairo_pie_errors.rs b/vm/src/vm/errors/cairo_pie_errors.rs index 899600d48a..bf0ec70068 100644 --- a/vm/src/vm/errors/cairo_pie_errors.rs +++ b/vm/src/vm/errors/cairo_pie_errors.rs @@ -1,4 +1,4 @@ -use thiserror_no_std::Error; +use thiserror::Error; use crate::types::builtin_name::BuiltinName; diff --git a/vm/src/vm/errors/cairo_run_errors.rs b/vm/src/vm/errors/cairo_run_errors.rs index d41e75fbfe..0197d8c601 100644 --- a/vm/src/vm/errors/cairo_run_errors.rs +++ b/vm/src/vm/errors/cairo_run_errors.rs @@ -1,4 +1,4 @@ -use thiserror_no_std::Error; +use thiserror::Error; use super::cairo_pie_errors::CairoPieValidationError; use super::memory_errors::MemoryError; diff --git a/vm/src/vm/errors/exec_scope_errors.rs b/vm/src/vm/errors/exec_scope_errors.rs index 6bb27387da..ec422dd32d 100644 --- a/vm/src/vm/errors/exec_scope_errors.rs +++ b/vm/src/vm/errors/exec_scope_errors.rs @@ -1,4 +1,4 @@ -use thiserror_no_std::Error; +use thiserror::Error; #[derive(Eq, Hash, PartialEq, Debug, Error)] pub enum ExecScopeError { diff --git a/vm/src/vm/errors/hint_errors.rs b/vm/src/vm/errors/hint_errors.rs index 4851980837..ddba2ce5ea 100644 --- a/vm/src/vm/errors/hint_errors.rs +++ b/vm/src/vm/errors/hint_errors.rs @@ -3,7 +3,7 @@ use crate::stdlib::prelude::*; -use thiserror_no_std::Error; +use thiserror::Error; use crate::Felt252; use num_bigint::{BigInt, BigUint}; diff --git a/vm/src/vm/errors/memory_errors.rs b/vm/src/vm/errors/memory_errors.rs index b6f02b0a85..b882208dd6 100644 --- a/vm/src/vm/errors/memory_errors.rs +++ b/vm/src/vm/errors/memory_errors.rs @@ -4,7 +4,7 @@ use crate::stdlib::prelude::*; use crate::types::builtin_name::BuiltinName; -use thiserror_no_std::Error; +use thiserror::Error; use crate::Felt252; diff --git a/vm/src/vm/errors/runner_errors.rs b/vm/src/vm/errors/runner_errors.rs index 98c0787810..09ebf8753d 100644 --- a/vm/src/vm/errors/runner_errors.rs +++ b/vm/src/vm/errors/runner_errors.rs @@ -4,7 +4,7 @@ use crate::stdlib::{collections::HashSet, prelude::*}; use crate::types::builtin_name::BuiltinName; use crate::types::layout_name::LayoutName; -use thiserror_no_std::Error; +use thiserror::Error; use super::{memory_errors::MemoryError, trace_errors::TraceError}; use crate::types::{errors::math_errors::MathError, relocatable::Relocatable}; diff --git a/vm/src/vm/errors/trace_errors.rs b/vm/src/vm/errors/trace_errors.rs index e2d24401c1..004235a9f3 100644 --- a/vm/src/vm/errors/trace_errors.rs +++ b/vm/src/vm/errors/trace_errors.rs @@ -1,4 +1,4 @@ -use thiserror_no_std::Error; +use thiserror::Error; use crate::vm::errors::memory_errors::MemoryError; diff --git a/vm/src/vm/errors/vm_errors.rs b/vm/src/vm/errors/vm_errors.rs index c3698eda02..fc9295665f 100644 --- a/vm/src/vm/errors/vm_errors.rs +++ b/vm/src/vm/errors/vm_errors.rs @@ -4,7 +4,7 @@ use crate::stdlib::prelude::*; use crate::types::builtin_name::BuiltinName; -use thiserror_no_std::Error; +use thiserror::Error; use crate::Felt252; use crate::{ diff --git a/vm/src/vm/errors/vm_exception.rs b/vm/src/vm/errors/vm_exception.rs index 005160d95b..140537f8f7 100644 --- a/vm/src/vm/errors/vm_exception.rs +++ b/vm/src/vm/errors/vm_exception.rs @@ -7,7 +7,7 @@ use crate::{ types::relocatable::Relocatable, }; -use thiserror_no_std::Error; +use thiserror::Error; use crate::{ hint_processor::hint_processor_utils::get_maybe_relocatable_from_reference,