macros: run runtime inside LocalSet when using macro (#4027)

This commit is contained in:
Ben Noordhuis
2021-09-15 11:25:02 +02:00
committed by GitHub
parent 4c9b469562
commit 33f0a1fd2e
4 changed files with 51 additions and 34 deletions
+4 -5
View File
@@ -339,11 +339,10 @@ fn parse_knobs(
{
let body = async #body;
#[allow(clippy::expect_used)]
#tail_return #rt
.enable_all()
.build()
.expect("Failed building the Runtime")
.block_on(body)#tail_semicolon
#tail_return tokio::task::LocalSet::new().block_on(
&#rt.enable_all().build().expect("Failed building the Runtime"),
body,
)#tail_semicolon
}
})
.expect("Parsing failure");