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

Thread safety error while compiling jmt crate #119

Open
mw2000 opened this issue Nov 3, 2024 · 0 comments
Open

Thread safety error while compiling jmt crate #119

mw2000 opened this issue Nov 3, 2024 · 0 comments

Comments

@mw2000
Copy link

mw2000 commented Nov 3, 2024

Running into the following error when I try to compile my program which imports the jmt = 0.10.0 crate. How can I get around this? I implement a wrapper KeccakHasher around alloy_primitives::Keccak for which I implement the SimpleHasher trait.

my_program:dev: error[E0277]: `T` cannot be sent between threads safely
my_program:dev:    --> /Users/mw2000/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jmt-0.10.0/src/lib.rs:327:34
my_program:dev:     |
my_program:dev: 327 | impl<T: Digest> SimpleHasher for T
my_program:dev:     |                                  ^ `T` cannot be sent between threads safely
my_program:dev:     |
my_program:dev: note: required by a bound in `SimpleHasher`
my_program:dev:    --> /Users/mw2000/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jmt-0.10.0/src/lib.rs:312:40
my_program:dev:     |
my_program:dev: 312 | pub trait SimpleHasher: Sized + Sync + Send {
my_program:dev:     |                                        ^^^^ required by this bound in `SimpleHasher`
my_program:dev: help: consider further restricting this bound
my_program:dev:     |
my_program:dev: 327 | impl<T: Digest + core::marker::Send> SimpleHasher for T
my_program:dev:     |                ++++++++++++++++++++
my_program:dev: 
my_program:dev: error[E0277]: `T` cannot be shared between threads safely
my_program:dev:    --> /Users/mw2000/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jmt-0.10.0/src/lib.rs:327:34
my_program:dev:     |
my_program:dev: 327 | impl<T: Digest> SimpleHasher for T
my_program:dev:     |                                  ^ `T` cannot be shared between threads safely
my_program:dev:     |
my_program:dev: note: required by a bound in `SimpleHasher`
my_program:dev:    --> /Users/mw2000/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jmt-0.10.0/src/lib.rs:312:33
my_program:dev:     |
my_program:dev: 312 | pub trait SimpleHasher: Sized + Sync + Send {
my_program:dev:     |                                 ^^^^ required by this bound in `SimpleHasher`
my_program:dev: help: consider further restricting this bound
my_program:dev:     |
my_program:dev: 327 | impl<T: Digest + core::marker::Sync> SimpleHasher for T
@mw2000 mw2000 changed the title Error while compiling jmt crate. Thread safety error while compiling jmt crate Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant