Skip to content

Commit

Permalink
Add PhantomData to stubs with type parameters, to fix a build issue o…
Browse files Browse the repository at this point in the history
…n nightly
  • Loading branch information
micolous committed Nov 24, 2023
1 parent 16fed53 commit 7e99ed5
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions webauthn-authenticator-rs/src/stubs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,21 @@ pub mod tokio {
}
pub mod sync {
pub mod mpsc {
pub struct Sender<T> {}
pub struct Receiver<T> {}
pub struct Sender<T> {
_phantom: std::marker::PhantomData<T>,
}
pub struct Receiver<T> {
_phantom: std::marker::PhantomData<T>,
}
}
}
pub mod time {
pub async fn sleep(_: std::time::Duration) {}
}
pub mod task {
pub struct JoinHandle<T> {}
pub struct JoinHandle<T> {
_phantom: std::marker::PhantomData<T>,
}
pub fn spawn<A, B>(future: A) -> JoinHandle<B> {}
pub fn spawn_blocking() {}
}
Expand All @@ -71,7 +77,9 @@ pub mod tokio {
#[cfg(not(feature = "ctap2"))]
pub mod tokio_stream {
pub mod wrappers {
pub struct ReceiverStream<T> {}
pub struct ReceiverStream<T> {
_phantom: std::marker::PhantomData<T>,
}
}
}

Expand All @@ -85,8 +93,12 @@ pub mod tokio_tungstenite {
}
}
}
pub struct MaybeTlsStream<T> {}
pub struct WebSocketStream<T> {}
pub struct MaybeTlsStream<T> {
_phantom: std::marker::PhantomData<T>,
}
pub struct WebSocketStream<T> {
_phantom: std::marker::PhantomData<T>,
}
}

#[cfg(not(any(feature = "bluetooth", feature = "cable")))]
Expand Down Expand Up @@ -120,9 +132,13 @@ pub mod openssl {
pub struct BigNumContext {}
}
pub mod ec {
pub struct EcKey<T> {}
pub struct EcKey<T> {
_phantom: std::marker::PhantomData<T>,
}
pub struct EcGroup {}
pub struct EcKeyRef<T> {}
pub struct EcKeyRef<T> {
_phantom: std::marker::PhantomData<T>,
}
pub struct EcPoint {}
pub struct EcPointRef {}
pub enum PointConversionForm {}
Expand All @@ -132,8 +148,12 @@ pub mod openssl {
}
pub mod pkey {
pub struct Id {}
pub struct PKey<T> {}
pub struct PKeyRef<T> {}
pub struct PKey<T> {
_phantom: std::marker::PhantomData<T>,
}
pub struct PKeyRef<T> {
_phantom: std::marker::PhantomData<T>,
}
pub struct Private {}
pub struct Public {}
}
Expand Down

0 comments on commit 7e99ed5

Please sign in to comment.