Skip to content

Commit ad69d85

Browse files
committed
works
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
1 parent 85f5cd7 commit ad69d85

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/future/future/mod.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,13 @@ extension_trait! {
139139
"#]
140140
#[cfg(any(feature = "unstable", feature = "docs"))]
141141
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
142-
fn select<F>(self, other: F) ->
143-
impl Future<Output = Self::Output> [Select<Self, F>]
142+
fn select<F>(
143+
self,
144+
other: F
145+
) -> impl Future<Output = <Self as std::future::Future>::Output> [Select<Self, F>]
144146
where
145-
Self: Sized + Future,
146-
F: std::future::Future<Output = <Self as Future>::Output>,
147+
Self: std::future::Future + Sized,
148+
F: std::future::Future<Output = <Self as std::future::Future>::Output>,
147149
{
148150
Select::new(self, other)
149151
}
@@ -178,12 +180,13 @@ extension_trait! {
178180
"#]
179181
#[cfg(any(feature = "unstable", feature = "docs"))]
180182
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
181-
fn try_select<F, T, E>(self, other: F) ->
182-
impl Future<Output = Self::Output> [TrySelect<Self, F>]
183+
fn try_select<F: std::future::Future, T, E>(
184+
self,
185+
other: F
186+
) -> impl Future<Output = <Self as std::future::Future>::Output> [TrySelect<Self, F>]
183187
where
184-
Self: Sized,
185-
Self: Future<Output = Result<T, E>>,
186-
F: Future<Output = Self::Output>,
188+
Self: std::future::Future<Output = Result<T, E>> + Sized,
189+
F: std::future::Future<Output = <Self as std::future::Future>::Output>,
187190
{
188191
TrySelect::new(self, other)
189192
}

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ macro_rules! extension_trait {
144144
};
145145

146146
// Parse the return type in an extension method.
147-
(@doc ($($head:tt)*) -> impl Future<Output = $out:ty> [$f:ty] $($tail:tt)*) => {
147+
(@doc ($($head:tt)*) -> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*) => {
148148
extension_trait!(@doc ($($head)* -> owned::ImplFuture<$out>) $($tail)*);
149149
};
150150
(@ext ($($head:tt)*) -> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*) => {

0 commit comments

Comments
 (0)