-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//! This module exists entirely to work around https://github.com/rust-lang/rust/issues/65863 | ||
/// impl Discover. | ||
/// | ||
/// https://github.com/rust-lang/rust/issues/65863 | ||
pub struct Discover<S>(std::marker::PhantomData<S>); | ||
|
||
impl<S> tower_discover::Discover for Discover<S> { | ||
type Key = usize; | ||
type Service = S; | ||
type Error = tokio::io::Error; | ||
|
||
fn poll_discover( | ||
self: std::pin::Pin<&mut Self>, | ||
_: &mut std::task::Context<'_>, | ||
) -> std::task::Poll<Result<tower_discover::Change<Self::Key, Self::Service>, Self::Error>> | ||
{ | ||
loop {} | ||
} | ||
} | ||
|
||
/// impl Future. | ||
/// | ||
/// https://github.com/rust-lang/rust/issues/65863 | ||
pub struct Future<O>(std::marker::PhantomData<O>); | ||
|
||
impl<O> std::future::Future for Future<O> { | ||
type Output = O; | ||
fn poll( | ||
self: std::pin::Pin<&mut Self>, | ||
_: &mut std::task::Context<'_>, | ||
) -> std::task::Poll<Self::Output> { | ||
loop {} | ||
} | ||
} | ||
|
||
/// impl Future. | ||
/// | ||
/// https://github.com/rust-lang/rust/issues/65863 | ||
pub struct FutureWithExtra<O, T>(std::marker::PhantomData<O>, std::marker::PhantomData<T>); | ||
|
||
impl<O, T> std::future::Future for FutureWithExtra<O, T> { | ||
type Output = O; | ||
fn poll( | ||
self: std::pin::Pin<&mut Self>, | ||
_: &mut std::task::Context<'_>, | ||
) -> std::task::Poll<Self::Output> { | ||
loop {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters