Skip to content
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ std = [
"starknet-crypto/std",
"felt/std",
"dep:num-prime",
"thiserror-no-std/std",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this makes me wonder, do we actually use anything that requires the std feature on thiserror? Did you try building without it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

The std version of thiserror generate the following line (which is not generated in no_std):

impl std::error::Error for <MyErrorType> {}

Copy link
Contributor Author

@tdelabro tdelabro Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future rust will move the Error trait in core tho

]
cairo-1-hints = ["dep:cairo-lang-starknet", "dep:cairo-lang-casm", "dep:ark-ff", "dep:ark-std"]
lambdaworks-felt = [
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions vm/src/cairo_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
3 changes: 0 additions & 3 deletions vm/src/types/errors/math_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
3 changes: 0 additions & 3 deletions vm/src/types/errors/program_errors.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 0 additions & 3 deletions vm/src/vm/errors/cairo_run_errors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#[cfg(feature = "std")]
use thiserror::Error;
#[cfg(not(feature = "std"))]
use thiserror_no_std::Error;

use super::memory_errors::MemoryError;
Expand Down
3 changes: 0 additions & 3 deletions vm/src/vm/errors/exec_scope_errors.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
3 changes: 0 additions & 3 deletions vm/src/vm/errors/hint_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions vm/src/vm/errors/memory_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions vm/src/vm/errors/runner_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions vm/src/vm/errors/trace_errors.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 0 additions & 3 deletions vm/src/vm/errors/vm_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
3 changes: 0 additions & 3 deletions vm/src/vm/errors/vm_exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down