Skip to content

Commit 07c4d0c

Browse files
balootarcieri
authored andcommitted
async-signature: move to AFIT
`AFIT` is expected in the upcoming rust-1.75 release (scheduled for 2023/12/28). `#[allow(async_fn_in_trait)]` is required until a solution to RPITIT is merged in rust. This put responsability on the implementor of `async_signature::AsyncSigner` to make sure their future is `Send`able. see rust-lang/rust#115822 (comment) for more context.
1 parent 05a23aa commit 07c4d0c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

async-signature/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ readme = "README.md"
1010
keywords = ["crypto", "ecdsa", "ed25519", "signature", "signing"]
1111
categories = ["cryptography", "no-std"]
1212
edition = "2021"
13-
rust-version = "1.60"
13+
rust-version = "1.75"
1414

1515
[dependencies]
1616
async-trait = "0.1.9"

async-signature/src/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ pub use signature::{self, Error};
1717
#[cfg(feature = "digest")]
1818
pub use signature::digest::{self, Digest};
1919

20-
use async_trait::async_trait;
2120

2221
/// Asynchronously sign the provided message bytestring using `Self`
2322
/// (e.g. client for a Cloud KMS or HSM), returning a digital signature.
2423
///
2524
/// This trait is an async equivalent of the [`signature::Signer`] trait.
26-
#[async_trait(?Send)]
25+
#[allow(async_fn_in_trait)]
2726
pub trait AsyncSigner<S: 'static> {
2827
/// Attempt to sign the given message, returning a digital signature on
2928
/// success, or an error if something went wrong.
@@ -33,7 +32,6 @@ pub trait AsyncSigner<S: 'static> {
3332
async fn sign_async(&self, msg: &[u8]) -> Result<S, Error>;
3433
}
3534

36-
#[async_trait(?Send)]
3735
impl<S, T> AsyncSigner<S> for T
3836
where
3937
S: 'static,
@@ -48,7 +46,7 @@ where
4846
///
4947
/// This trait is an async equivalent of the [`signature::DigestSigner`] trait.
5048
#[cfg(feature = "digest")]
51-
#[async_trait(?Send)]
49+
#[allow(async_fn_in_trait)]
5250
pub trait AsyncDigestSigner<D, S>
5351
where
5452
D: Digest + 'static,
@@ -60,7 +58,6 @@ where
6058
}
6159

6260
#[cfg(feature = "digest")]
63-
#[async_trait(?Send)]
6461
impl<D, S, T> AsyncDigestSigner<D, S> for T
6562
where
6663
D: Digest + 'static,

0 commit comments

Comments
 (0)