Skip to content

Commit

Permalink
feat: use educe to implement Hash for Ident
Browse files Browse the repository at this point in the history
  • Loading branch information
bing committed Jun 10, 2024
1 parent cfb3808 commit c72d5c3
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 15 deletions.
33 changes: 33 additions & 0 deletions Cargo.lock

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

27 changes: 14 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ark-ff = "0.3.0"
ark-bls12-381 = "0.3.0" # bls12-381 curve for r1cs backend
ark-bn254 = "0.3.0" # bn128 curve for r1cs backend
ark-serialize = "0.3.0" # serialization of arkworks types
educe = { version = "0.6", default-features = false, features = ["Hash"] }
ena = "0.14.0" # union-find implementation for the wiring
num-bigint = "0.4.3" # big int library
camino = "1.1.1" # to replace Path and PathBuf
Expand All @@ -20,16 +21,16 @@ dirs = "4.0.0"
itertools = "0.10.3" # useful iter traits
kimchi = { git = "https://github.com/o1-labs/proof-systems", rev = "a5d8883ddf649c22f38aaac122d368ecb9fa2230" } # ZKP - Dec 5th, 2023 revision
#kimchi = { git = "https://github.com/o1-labs/proof-systems", rev = "b9589626f834f9dbf9d587e73fd8176171231e90" } # ZKP
miette = { version = "5.0.0", features = ["fancy"] } # nice errors
num-traits = "0.2.15" # useful traits on big ints
once_cell = "1.15.0" # for lazy statics
regex = "1.6.0" # for regexes
rmp-serde = "1.1.1" # for serialization
serde_with = "2.0.1" # for serializing arkworks types
serde_json = "1.0.85" # to (de)serialize JSON
serde = "1.0.144" # to (de)serialize objects
thiserror = "1.0.31" # helpful error traits
toml = "0.8.8" # to parse manifest files
constraint_writers = { git = "https://github.com/iden3/circom.git", tag = "v2.1.8"} # to generate r1cs file
num-bigint-dig = "0.6.0" # to adapt for circom lib
rstest = "0.19.0" # for testing different backend cases
miette = { version = "5.0.0", features = ["fancy"] } # nice errors
num-traits = "0.2.15" # useful traits on big ints
once_cell = "1.15.0" # for lazy statics
regex = "1.6.0" # for regexes
rmp-serde = "1.1.1" # for serialization
serde_with = "2.0.1" # for serializing arkworks types
serde_json = "1.0.85" # to (de)serialize JSON
serde = "1.0.144" # to (de)serialize objects
thiserror = "1.0.31" # helpful error traits
toml = "0.8.8" # to parse manifest files
constraint_writers = { git = "https://github.com/iden3/circom.git", tag = "v2.1.8" } # to generate r1cs file
num-bigint-dig = "0.6.0" # to adapt for circom lib
rstest = "0.19.0" # for testing different backend cases
2 changes: 1 addition & 1 deletion book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ additional-css = ["./mdbook-admonish.css"]

[preprocessor.admonish]
command = "mdbook-admonish"
assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install`
assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install`
5 changes: 4 additions & 1 deletion src/parser/types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use educe::Educe;
use std::{
fmt::Display,
hash::{Hash, Hasher},
Expand Down Expand Up @@ -392,9 +393,11 @@ impl FnSig {
}

/// Any kind of text that can represent a type, a variable, a function name, etc.
#[derive(Debug, Default, Clone, Eq, Hash, Serialize, Deserialize)]
#[derive(Debug, Default, Clone, Eq, Serialize, Deserialize, Educe)]
#[educe(Hash)]
pub struct Ident {
pub value: String,
#[educe(Hash(ignore))]
pub span: Span,
}

Expand Down

0 comments on commit c72d5c3

Please sign in to comment.