Skip to content

Commit cc38f2f

Browse files
committed
Move regression test to module
1 parent 7a1e0e9 commit cc38f2f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

tests/test.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
use async_trait::async_trait;
44

5-
// Renaming to avoid masking missing absolute paths in generated code.
6-
use std::future::Future as StdFuture;
7-
85
#[async_trait]
96
trait Trait {
107
type Assoc;
@@ -120,14 +117,19 @@ pub async fn test_object_safe_with_default() {
120117
}
121118

122119
// 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
120+
mod issue2 {
121+
use async_trait::async_trait;
122+
use std::future::Future;
123+
124+
#[async_trait]
125+
pub trait Issue2: Future {
126+
async fn flatten(self) -> <<Self as Future>::Output as Future>::Output
127+
where
128+
Self::Output: Future + Send,
129+
Self: Sized,
130+
{
131+
let nested_future = self.await;
132+
nested_future.await
133+
}
132134
}
133135
}

0 commit comments

Comments
 (0)