-
Notifications
You must be signed in to change notification settings - Fork 107
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
ecdsa: fixup unnecessary qualification
warnings
#824
Conversation
@@ -419,9 +419,9 @@ where | |||
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>, | |||
FieldBytesSize<C>: sec1::ModulusSize, | |||
{ | |||
type Error = pkcs8::spki::Error; | |||
type Error = spki::Error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird... spki
doesn't seem to be in scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is interesting.
This is an (optional) direct dependency. It is still in scope most of the time but not for this specific set of features:
cargo +stable build -p ecdsa --features pkcs8,verifying --no-default-features
Compiling ecdsa v0.17.0-pre.5 (/home/arthur_gautier/work/dev/signatures/ecdsa)
error[E0433]: failed to resolve: use of undeclared crate or module `spki`
--> ecdsa/src/verifying.rs:422:18
|
422 | type Error = spki::Error;
| ^^^^ use of undeclared crate or module `spki`
|
help: consider importing this crate
|
3 + use crate::verifying::pkcs8::spki;
|
error[E0433]: failed to resolve: use of undeclared crate or module `spki`
--> ecdsa/src/verifying.rs:424:62
|
424 | fn try_from(spki: pkcs8::SubjectPublicKeyInfoRef<'_>) -> spki::Result<Self> {
| ^^^^ use of undeclared crate or module `spki`
|
help: consider importing this crate
|
3 + use crate::verifying::pkcs8::spki;
|
For more information about this error, try `rustc --explain E0433`.
error: could not compile `ecdsa` (lib) due to 2 previous errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you can unconditionally import it when the pkcs8
feature is enabled from pkcs8::spki
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would also have been an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I was suggesting the same thing you actually did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<
I've read it too fast and I thought you meant:
$ git diff
diff --git a/ecdsa/Cargo.toml b/ecdsa/Cargo.toml
index 2ccbfd8..3d93622 100644
--- a/ecdsa/Cargo.toml
+++ b/ecdsa/Cargo.toml
@@ -41,7 +41,7 @@ arithmetic = ["elliptic-curve/arithmetic"]
dev = ["arithmetic", "digest", "elliptic-curve/dev", "hazmat"]
digest = ["dep:digest", "signature/digest"]
hazmat = []
-pkcs8 = ["digest", "elliptic-curve/pkcs8", "der"]
+pkcs8 = ["digest", "elliptic-curve/pkcs8", "der", "dep:spki"]
pem = ["elliptic-curve/pem", "pkcs8"]
serde = ["elliptic-curve/serde", "serdect"]
signing = ["arithmetic", "digest", "hazmat", "rfc6979"]
a00ef64
to
d089293
Compare
rust 1.78 introduced new unnecessary qualification warnings.