From acac38a794cec71db8ca217c0004b49ac92da4fe Mon Sep 17 00:00:00 2001 From: Matthew Pomes Date: Sun, 7 Jul 2024 17:35:11 -0500 Subject: [PATCH] Drop Rocket inside the tokio async context when using launch Moves error printing and the implicit drop inside the tokio runtime when using the `#[launch]` attribute. --- core/codegen/src/attribute/entry/launch.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/codegen/src/attribute/entry/launch.rs b/core/codegen/src/attribute/entry/launch.rs index a97c5eaa5d..48dcda3d14 100644 --- a/core/codegen/src/attribute/entry/launch.rs +++ b/core/codegen/src/attribute/entry/launch.rs @@ -113,7 +113,9 @@ impl EntryAttr for Launch { #[allow(dead_code)] #f #vis #sig { - #_error::Error::report(::rocket::async_main(#launch)) + ::rocket::async_main(async move { + #_error::Error::report(#launch.await) + }) } )) }