Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace thiserror-no-std with thiserror 2 #1919

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }

Expand Down
2 changes: 1 addition & 1 deletion cairo-vm-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion cairo-vm-tracer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cairo-vm-tracer/src/error/trace_data_errors.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cairo1-run/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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 }

Expand Down
2 changes: 1 addition & 1 deletion vm/src/air_public_input.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::Felt252;
use serde::{Deserialize, Serialize};
use thiserror_no_std::Error;
use thiserror::Error;

use crate::{
stdlib::{
Expand Down
2 changes: 1 addition & 1 deletion vm/src/cairo_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
4 changes: 2 additions & 2 deletions vm/src/program_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion vm/src/types/errors/math_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion vm/src/types/errors/program_errors.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/errors/cairo_pie_errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use thiserror_no_std::Error;
use thiserror::Error;

use crate::types::builtin_name::BuiltinName;

Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/errors/cairo_run_errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use thiserror_no_std::Error;
use thiserror::Error;

use super::cairo_pie_errors::CairoPieValidationError;
use super::memory_errors::MemoryError;
Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/errors/exec_scope_errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use thiserror_no_std::Error;
use thiserror::Error;

#[derive(Eq, Hash, PartialEq, Debug, Error)]
pub enum ExecScopeError {
Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/errors/hint_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use crate::stdlib::prelude::*;

use thiserror_no_std::Error;
use thiserror::Error;

use crate::Felt252;
use num_bigint::{BigInt, BigUint};
Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/errors/memory_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/errors/runner_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/errors/trace_errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use thiserror_no_std::Error;
use thiserror::Error;

use crate::vm::errors::memory_errors::MemoryError;

Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/errors/vm_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/errors/vm_exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down