You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like the serde derive implementation is not being compiled for k256::ecdsa::VerifyingKey when the serde feature flag is active.
Minimal reproduction:
[package]
name = "k256-serde"version = "0.1.0"edition = "2021"
[dependencies]
k256 = { version = "0.14.0-pre.2", default-features = false, features = ["serde", "ecdsa", "std"] }
serde_json = "1"rand = "0.8"
use k256::ecdsa::SigningKey;use rand::rngs::OsRng;fnmain(){let key = SigningKey::random(&mutOsRng);let verifying_key = key.verifying_key();
serde_json::to_string(verifying_key).unwrap();}
Yields the compiler error:
error[E0277]: the trait bound `ecdsa::verifying::VerifyingKey<Secp256k1>: serde::ser::Serialize` is not satisfied
--> src/main.rs:7:27
|
7 | serde_json::to_string(verifying_key).unwrap();
| --------------------- ^^^^^^^^^^^^^ the trait `serde::ser::Serialize` is not implemented for `ecdsa::verifying::VerifyingKey<Secp256k1>`
| |
| required by a bound introduced by this call
|
= note: for local types consider adding `#[derive(serde::Serialize)]` to your `ecdsa::verifying::VerifyingKey<Secp256k1>` type
= note: for types from other crates check whether the crate offers a `serde` feature flag
= help: the following other types implement trait `serde::ser::Serialize`:
&'a T
&'a mut T
()
(T,)
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and 142 others
note: required by a bound in `serde_json::to_string`
--> /Users/muji/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.128/src/ser.rs:2209:17
|
2207 | pub fn to_string<T>(value: &T) -> Result<String>
| --------- required by a bound in this function
2208 | where
2209 | T: ?Sized + Serialize,
| ^^^^^^^^^ required by this bound in `to_string`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `k256-serde` (bin "k256-serde") due to 1 previous error
Is this an error my end or a problem with propagating the feature flag perhaps?
The text was updated successfully, but these errors were encountered:
Seems like the serde derive implementation is not being compiled for
k256::ecdsa::VerifyingKey
when theserde
feature flag is active.Minimal reproduction:
Yields the compiler error:
Is this an error my end or a problem with propagating the feature flag perhaps?
The text was updated successfully, but these errors were encountered: