mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-07 00:00:09 +02:00
macros: fix unused_braces in generated code (#3404)
This commit is contained in:
@@ -254,7 +254,7 @@ fn parse_knobs(
|
||||
.enable_all()
|
||||
.build()
|
||||
.unwrap()
|
||||
.block_on(async { #body })
|
||||
.block_on(async #body)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -17,3 +17,11 @@ async fn test_macro_is_resilient_to_shadowing() {
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
// 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") }
|
||||
#[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) }
|
||||
|
||||
Reference in New Issue
Block a user