Skip to content

Commit

Permalink
Remove workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed Jul 27, 2020
1 parent 6ce46c5 commit 3dcf0ea
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 76 deletions.
6 changes: 0 additions & 6 deletions noria/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ where
type Response = hyper::body::Bytes;
type Error = failure::Error;

#[cfg(not(doc))]
type Future = impl Future<Output = Result<Self::Response, Self::Error>> + Send;
#[cfg(doc)]
type Future = crate::doc_mock::Future<Result<Self::Response, Self::Error>>;

fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
Expand Down Expand Up @@ -175,10 +172,7 @@ impl ControllerHandle<consensus::ZookeeperAuthority> {

// this alias is needed to work around -> impl Trait capturing _all_ lifetimes by default
// the A parameter is needed so it gets captured into the impl Trait
#[cfg(not(doc))]
type RpcFuture<A, R> = impl Future<Output = Result<R, failure::Error>>;
#[cfg(doc)]
type RpcFuture<A, R> = crate::doc_mock::FutureWithExtra<Result<R, failure::Error>, A>;

// Needed b/c of https://github.com/rust-lang/rust/issues/65442
async fn finalize<R, E>(
Expand Down
50 changes: 0 additions & 50 deletions noria/src/doc_mock.rs

This file was deleted.

2 changes: 0 additions & 2 deletions noria/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ pub mod channel;
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411
pub mod consensus;
#[doc(hidden)]
pub mod doc_mock;
#[doc(hidden)]
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411
pub mod internal;

Expand Down
9 changes: 0 additions & 9 deletions noria/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,7 @@ impl Service<()> for Endpoint {
type Response = InnerService;
type Error = tokio::io::Error;

#[cfg(not(doc))]
type Future = impl Future<Output = Result<Self::Response, Self::Error>>;
#[cfg(doc)]
type Future = crate::doc_mock::Future<Result<Self::Response, Self::Error>>;

fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
Expand Down Expand Up @@ -260,12 +257,9 @@ fn make_table_discover(addr: SocketAddr) -> Discover {
}

// Unpin + Send bounds are needed due to https://github.com/rust-lang/rust/issues/55997
#[cfg(not(doc))]
type Discover = impl tower_discover::Discover<Key = usize, Service = InnerService, Error = tokio::io::Error>
+ Unpin
+ Send;
#[cfg(doc)]
type Discover = crate::doc_mock::Discover<InnerService>;

pub(crate) type TableRpc = Buffer<
ConcurrencyLimit<Balance<Discover, Tagged<LocalOrNot<Input>>>>,
Expand Down Expand Up @@ -585,10 +579,7 @@ impl Service<Vec<TableOperation>> for Table {
type Error = TableError;
type Response = <TableRpc as Service<Tagged<LocalOrNot<Input>>>>::Response;

#[cfg(not(doc))]
type Future = impl Future<Output = Result<Tagged<()>, TableError>> + Send;
#[cfg(doc)]
type Future = crate::doc_mock::Future<Result<Tagged<()>, TableError>>;

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
for s in &mut self.shards {
Expand Down
9 changes: 0 additions & 9 deletions noria/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ impl Service<()> for Endpoint {
type Response = InnerService;
type Error = tokio::io::Error;

#[cfg(not(doc))]
type Future = impl Future<Output = Result<Self::Response, Self::Error>>;
#[cfg(doc)]
type Future = crate::doc_mock::Future<Result<Self::Response, Self::Error>>;

fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
Expand Down Expand Up @@ -85,12 +82,9 @@ fn make_views_discover(addr: SocketAddr) -> Discover {
}

// Unpin + Send bounds are needed due to https://github.com/rust-lang/rust/issues/55997
#[cfg(not(doc))]
type Discover = impl tower_discover::Discover<Key = usize, Service = InnerService, Error = tokio::io::Error>
+ Unpin
+ Send;
#[cfg(doc)]
type Discover = crate::doc_mock::Discover<InnerService>;

pub(crate) type ViewRpc =
Buffer<ConcurrencyLimit<Balance<Discover, Tagged<ReadQuery>>>, Tagged<ReadQuery>>;
Expand Down Expand Up @@ -241,10 +235,7 @@ impl Service<(Vec<Vec<DataType>>, bool)> for View {
type Response = Vec<Results>;
type Error = ViewError;

#[cfg(not(doc))]
type Future = impl Future<Output = Result<Self::Response, Self::Error>> + Send;
#[cfg(doc)]
type Future = crate::doc_mock::Future<Result<Self::Response, Self::Error>>;

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
for s in &mut self.shards {
Expand Down

0 comments on commit 3dcf0ea

Please sign in to comment.