From 4996e276733a13fd16b2a08f617570ea201718ba Mon Sep 17 00:00:00 2001 From: daxpedda Date: Sun, 26 Jan 2020 18:35:39 +0100 Subject: macros: fix skipping generics on #[tokio::main] (#2177) When using #[tokio::main] on a function with generics, the generics are skipped. Simply using #vis #sig instead of #vis fn #name(#inputs) #ret fixes the problem. Fixes #2176 --- tests-integration/tests/macros_main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests-integration') diff --git a/tests-integration/tests/macros_main.rs b/tests-integration/tests/macros_main.rs index 182e2779..42f5be3b 100644 --- a/tests-integration/tests/macros_main.rs +++ b/tests-integration/tests/macros_main.rs @@ -5,6 +5,11 @@ async fn basic_main() -> usize { 1 } +#[tokio::main] +async fn generic_fun() -> T { + T::default() +} + #[cfg(feature = "rt-core")] mod spawn { #[tokio::main] @@ -22,4 +27,5 @@ mod spawn { #[test] fn shell() { assert_eq!(1, basic_main()); + assert_eq!(bool::default(), generic_fun::()) } -- cgit v1.2.3