Skip to content

Commit f0f9309

Browse files
committed
Move function argument cfg tests to issue-specific regression test
1 parent 2866cb9 commit f0f9309

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

tests/test.rs

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ trait Trait {
5454
async fn calls_mut(&mut self) {
5555
self.selfmut().await;
5656
}
57-
58-
async fn cfg_param(&self, param: u8);
59-
async fn cfg_param_wildcard(&self, _: u8);
60-
async fn cfg_param_tuple(&self, (left, right): (u8, u8));
6157
}
6258

6359
struct Struct;
@@ -91,17 +87,6 @@ impl Trait for Struct {
9187
async fn calls_mut(&mut self) {
9288
self.selfmut().await;
9389
}
94-
95-
async fn cfg_param(&self, #[cfg(any())] param: u8, #[cfg(all())] _unused: u8) {}
96-
97-
async fn cfg_param_wildcard(&self, #[cfg(any())] _: u8, #[cfg(all())] _: u8) {}
98-
99-
async fn cfg_param_tuple(
100-
&self,
101-
#[cfg(any())] (left, right): (u8, u8),
102-
#[cfg(all())] (_left, _right): (u8, u8),
103-
) {
104-
}
10590
}
10691

10792
pub async fn test() {
@@ -1479,3 +1464,31 @@ pub mod issue210 {
14791464
async fn f(self: Arc<Self>) {}
14801465
}
14811466
}
1467+
1468+
// https://github.com/dtolnay/async-trait/issues/226
1469+
pub mod issue226 {
1470+
use async_trait::async_trait;
1471+
1472+
#[async_trait]
1473+
pub trait Trait {
1474+
async fn cfg_param(&self, param: u8);
1475+
async fn cfg_param_wildcard(&self, _: u8);
1476+
async fn cfg_param_tuple(&self, (left, right): (u8, u8));
1477+
}
1478+
1479+
struct Struct;
1480+
1481+
#[async_trait]
1482+
impl Trait for Struct {
1483+
async fn cfg_param(&self, #[cfg(any())] param: u8, #[cfg(all())] _unused: u8) {}
1484+
1485+
async fn cfg_param_wildcard(&self, #[cfg(any())] _: u8, #[cfg(all())] _: u8) {}
1486+
1487+
async fn cfg_param_tuple(
1488+
&self,
1489+
#[cfg(any())] (left, right): (u8, u8),
1490+
#[cfg(all())] (_left, _right): (u8, u8),
1491+
) {
1492+
}
1493+
}
1494+
}

0 commit comments

Comments
 (0)