diff options
Diffstat (limited to 'tests/macros_test.rs')
-rw-r--r-- | tests/macros_test.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/macros_test.rs b/tests/macros_test.rs index 8396398..f5bc5a0 100644 --- a/tests/macros_test.rs +++ b/tests/macros_test.rs @@ -21,7 +21,20 @@ async fn test_macro_is_resilient_to_shadowing() { // https://github.com/tokio-rs/tokio/issues/3403 #[rustfmt::skip] // this `rustfmt::skip` is necessary because unused_braces does not warn if the block contains newline. #[tokio::main] -async fn unused_braces_main() { println!("hello") } +pub async fn unused_braces_main() { println!("hello") } #[rustfmt::skip] // this `rustfmt::skip` is necessary because unused_braces does not warn if the block contains newline. #[tokio::test] async fn unused_braces_test() { assert_eq!(1 + 1, 2) } + +// https://github.com/tokio-rs/tokio/pull/3766#issuecomment-835508651 +#[std::prelude::v1::test] +fn trait_method() { + trait A { + fn f(self); + } + impl A for () { + #[tokio::main] + async fn f(self) {} + } + ().f() +} |