From 36a73d23de844767b1d6858a6455857ade0ed0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Delabrouille?= Date: Mon, 26 Jun 2023 17:20:34 +0200 Subject: [PATCH] build(vm): remove thiserror form deps --- CHANGELOG.md | 3 +++ Cargo.lock | 1 - Cargo.toml | 1 - vm/Cargo.toml | 2 +- vm/src/cairo_run.rs | 3 --- vm/src/types/errors/math_errors.rs | 3 --- vm/src/types/errors/program_errors.rs | 3 --- vm/src/vm/errors/cairo_run_errors.rs | 3 --- vm/src/vm/errors/exec_scope_errors.rs | 3 --- vm/src/vm/errors/hint_errors.rs | 3 --- vm/src/vm/errors/memory_errors.rs | 3 --- vm/src/vm/errors/runner_errors.rs | 3 --- vm/src/vm/errors/trace_errors.rs | 3 --- vm/src/vm/errors/vm_errors.rs | 3 --- vm/src/vm/errors/vm_exception.rs | 3 --- 15 files changed, 4 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98f06c16f8..94e9ce7cba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ #### Upcoming Changes +* build: remove dependecy to `thiserror` (use `thiserror-no-std/std` instead) + * chore: use LambdaWorks' implementation of bit operations for `Felt252` [#1291](https://github.com/lambdaclass/cairo-rs/pull/1291) #### [0.8.0] - 2023-6-26 @@ -24,6 +26,7 @@ * build: remove unused implicit features from cairo-vm [#1266](https://github.com/lambdaclass/cairo-rs/pull/1266) + #### [0.6.1] - 2023-6-23 * fix: updated the `custom_hint_example` and added it to the workspace [#1258](https://github.com/lambdaclass/cairo-rs/pull/1258) diff --git a/Cargo.lock b/Cargo.lock index 06d004a299..c8837756cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -737,7 +737,6 @@ dependencies = [ "sha2", "sha3", "starknet-crypto", - "thiserror", "thiserror-no-std", "wasm-bindgen-test", ] diff --git a/Cargo.toml b/Cargo.toml index 7e2695fefd..2dec1bbe18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,6 @@ generic-array = { version = "0.14.6", default-features = false } keccak = { version = "0.1.2", default-features = false } hashbrown = { version = "0.13.2", features = ["serde"] } anyhow = { version = "1.0.69", default-features = false } -thiserror = { version = "1.0.32", default-features = false } thiserror-no-std = { version = "2.0.2", default-features = false } felt = { package = "cairo-felt", path = "./felt", version = "0.8.0", default-features = false, features = [ diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 0f48ddb1ac..abff3c6086 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -18,6 +18,7 @@ std = [ "starknet-crypto/std", "felt/std", "dep:num-prime", + "thiserror-no-std/std", ] cairo-1-hints = ["dep:cairo-lang-starknet", "dep:cairo-lang-casm", "dep:ark-ff", "dep:ark-std"] lambdaworks-felt = [ @@ -53,7 +54,6 @@ generic-array = { workspace = true } keccak = { workspace = true } hashbrown = { workspace = true } anyhow = { workspace = true } -thiserror = { workspace = true } thiserror-no-std = { workspace = true } # only for std diff --git a/vm/src/cairo_run.rs b/vm/src/cairo_run.rs index bfa7f0585e..f1a6ca0bc2 100644 --- a/vm/src/cairo_run.rs +++ b/vm/src/cairo_run.rs @@ -12,9 +12,6 @@ use crate::{ use bincode::enc::write::Writer; use felt::Felt252; -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::Error; pub struct CairoRunConfig<'a> { diff --git a/vm/src/types/errors/math_errors.rs b/vm/src/types/errors/math_errors.rs index c03f002d12..15cacc0d21 100644 --- a/vm/src/types/errors/math_errors.rs +++ b/vm/src/types/errors/math_errors.rs @@ -5,9 +5,6 @@ use crate::stdlib::boxed::Box; use felt::Felt252; use num_bigint::{BigInt, BigUint}; -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::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 09398d6f5b..7748874f17 100644 --- a/vm/src/types/errors/program_errors.rs +++ b/vm/src/types/errors/program_errors.rs @@ -1,8 +1,5 @@ use crate::stdlib::prelude::*; -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::Error; use felt::PRIME_STR; diff --git a/vm/src/vm/errors/cairo_run_errors.rs b/vm/src/vm/errors/cairo_run_errors.rs index 0400edb1c0..24a8a3552b 100644 --- a/vm/src/vm/errors/cairo_run_errors.rs +++ b/vm/src/vm/errors/cairo_run_errors.rs @@ -1,6 +1,3 @@ -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::Error; 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 8786c9d9be..6bb27387da 100644 --- a/vm/src/vm/errors/exec_scope_errors.rs +++ b/vm/src/vm/errors/exec_scope_errors.rs @@ -1,6 +1,3 @@ -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::Error; #[derive(Eq, Hash, PartialEq, Debug, Error)] diff --git a/vm/src/vm/errors/hint_errors.rs b/vm/src/vm/errors/hint_errors.rs index 846bc9b296..d94c7680a2 100644 --- a/vm/src/vm/errors/hint_errors.rs +++ b/vm/src/vm/errors/hint_errors.rs @@ -3,9 +3,6 @@ use crate::stdlib::prelude::*; -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::Error; use felt::Felt252; diff --git a/vm/src/vm/errors/memory_errors.rs b/vm/src/vm/errors/memory_errors.rs index f97aee5bbb..e63c0fb8bd 100644 --- a/vm/src/vm/errors/memory_errors.rs +++ b/vm/src/vm/errors/memory_errors.rs @@ -3,9 +3,6 @@ use crate::stdlib::prelude::*; -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::Error; use felt::Felt252; diff --git a/vm/src/vm/errors/runner_errors.rs b/vm/src/vm/errors/runner_errors.rs index 45c4ea23f2..ddd39e7269 100644 --- a/vm/src/vm/errors/runner_errors.rs +++ b/vm/src/vm/errors/runner_errors.rs @@ -3,9 +3,6 @@ use crate::stdlib::{collections::HashSet, prelude::*}; -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::Error; use super::memory_errors::MemoryError; diff --git a/vm/src/vm/errors/trace_errors.rs b/vm/src/vm/errors/trace_errors.rs index a37678a8a0..e2d24401c1 100644 --- a/vm/src/vm/errors/trace_errors.rs +++ b/vm/src/vm/errors/trace_errors.rs @@ -1,6 +1,3 @@ -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::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 5db2338e7d..ba9f8a0941 100644 --- a/vm/src/vm/errors/vm_errors.rs +++ b/vm/src/vm/errors/vm_errors.rs @@ -3,9 +3,6 @@ use crate::stdlib::prelude::*; -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::Error; use crate::{ diff --git a/vm/src/vm/errors/vm_exception.rs b/vm/src/vm/errors/vm_exception.rs index dd268c5f46..3e2b6e621f 100644 --- a/vm/src/vm/errors/vm_exception.rs +++ b/vm/src/vm/errors/vm_exception.rs @@ -4,9 +4,6 @@ use crate::stdlib::{ str, }; -#[cfg(feature = "std")] -use thiserror::Error; -#[cfg(not(feature = "std"))] use thiserror_no_std::Error; use crate::{