Skip to content

Commit 83dcc6d

Browse files
committed
workaround bug in rustdoc
rust-lang/rust#58011
1 parent 17836b2 commit 83dcc6d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/dispatcher/async.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::dispatcher::Dispatcher;
22
use futures::channel::{mpsc, oneshot};
3-
use futures::future::{FutureExt, TryFutureExt};
3+
use futures::future::{TryFutureExt, UnwrapOrElse};
44
use futures::stream::StreamExt;
55
use futures::task::{SpawnError, SpawnExt};
66
use std::marker::PhantomData;
@@ -157,7 +157,11 @@ impl<D, A> Dispatcher<A> for AsyncHandle<D, A>
157157
where
158158
D: Dispatcher<A>,
159159
{
160-
existential type Output: FutureExt<Output = D::Output>;
160+
/// A type that implements `FutureExt<Output = D::Output>`.
161+
///
162+
/// _**Important:** do not rely on the actual type,_
163+
/// _this will become an existential type once issues with rustdoc are solved._
164+
type Output = Promise<D::Output>;
161165

162166
/// Asynchronously sends an action through the dispatcher managed by [Async](struct.Async.html)
163167
/// and returns a *promise* to its output.
@@ -175,6 +179,8 @@ where
175179
}
176180
}
177181

182+
type Promise<T> = UnwrapOrElse<oneshot::Receiver<T>, fn(oneshot::Canceled) -> T>;
183+
178184
#[cfg(test)]
179185
mod tests {
180186
use super::*;

src/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
//!
3030
//! Enables integration with [futures-rs](https://crates.io/crates/futures-preview).
3131
32-
#![cfg_attr(
33-
feature = "async",
34-
feature(async_await, await_macro, futures_api, existential_type)
35-
)]
32+
#![cfg_attr(feature = "async", feature(async_await, await_macro, futures_api))]
3633

3734
mod macros;
3835
mod mock;

0 commit comments

Comments
 (0)