We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd019f2 commit 9c6cd9cCopy full SHA for 9c6cd9c
tests/test.rs
@@ -2,6 +2,9 @@
2
3
use async_trait::async_trait;
4
5
+// Renaming to avoid masking missing absolute paths in generated code.
6
+use std::future::Future as StdFuture;
7
+
8
#[async_trait]
9
trait Trait {
10
type Assoc;
@@ -115,3 +118,16 @@ pub async fn test_object_safe_with_default() {
115
118
let object = &Struct as &dyn ObjectSafe;
116
119
object.f().await;
117
120
}
121
122
+// https://github.com/dtolnay/async-trait/issues/2
123
+#[async_trait]
124
+pub trait Issue2: StdFuture {
125
+ async fn flatten(self) -> <<Self as StdFuture>::Output as StdFuture>::Output
126
+ where
127
+ Self::Output: StdFuture + Send,
128
+ Self: Sized,
129
+ {
130
+ let nested_future = self.await;
131
+ nested_future.await
132
+ }
133
+}
0 commit comments