diff --git a/tests/test.rs b/tests/test.rs index 7b9078d..19e9165 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -54,10 +54,6 @@ trait Trait { async fn calls_mut(&mut self) { self.selfmut().await; } - - async fn cfg_param(&self, param: u8); - async fn cfg_param_wildcard(&self, _: u8); - async fn cfg_param_tuple(&self, (left, right): (u8, u8)); } struct Struct; @@ -91,17 +87,6 @@ impl Trait for Struct { async fn calls_mut(&mut self) { self.selfmut().await; } - - async fn cfg_param(&self, #[cfg(any())] param: u8, #[cfg(all())] _unused: u8) {} - - async fn cfg_param_wildcard(&self, #[cfg(any())] _: u8, #[cfg(all())] _: u8) {} - - async fn cfg_param_tuple( - &self, - #[cfg(any())] (left, right): (u8, u8), - #[cfg(all())] (_left, _right): (u8, u8), - ) { - } } pub async fn test() { @@ -1479,3 +1464,31 @@ pub mod issue210 { async fn f(self: Arc) {} } } + +// https://github.com/dtolnay/async-trait/issues/226 +pub mod issue226 { + use async_trait::async_trait; + + #[async_trait] + pub trait Trait { + async fn cfg_param(&self, param: u8); + async fn cfg_param_wildcard(&self, _: u8); + async fn cfg_param_tuple(&self, (left, right): (u8, u8)); + } + + struct Struct; + + #[async_trait] + impl Trait for Struct { + async fn cfg_param(&self, #[cfg(any())] param: u8, #[cfg(all())] _unused: u8) {} + + async fn cfg_param_wildcard(&self, #[cfg(any())] _: u8, #[cfg(all())] _: u8) {} + + async fn cfg_param_tuple( + &self, + #[cfg(any())] (left, right): (u8, u8), + #[cfg(all())] (_left, _right): (u8, u8), + ) { + } + } +}