From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/tracing-attributes/tests/async_fn.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'vendor/tracing-attributes/tests/async_fn.rs') diff --git a/vendor/tracing-attributes/tests/async_fn.rs b/vendor/tracing-attributes/tests/async_fn.rs index 7e27fb5ce..c89963672 100644 --- a/vendor/tracing-attributes/tests/async_fn.rs +++ b/vendor/tracing-attributes/tests/async_fn.rs @@ -14,6 +14,7 @@ async fn test_async_fn(polls: usize) -> Result<(), ()> { // Reproduces a compile error when returning an `impl Trait` from an // instrumented async fn (see https://github.com/tokio-rs/tracing/issues/1615) +#[allow(dead_code)] // this is just here to test whether it compiles. #[instrument] async fn test_ret_impl_trait(n: i32) -> Result, ()> { let n = n; @@ -22,6 +23,7 @@ async fn test_ret_impl_trait(n: i32) -> Result, ()> { // Reproduces a compile error when returning an `impl Trait` from an // instrumented async fn (see https://github.com/tokio-rs/tracing/issues/1615) +#[allow(dead_code)] // this is just here to test whether it compiles. #[instrument(err)] async fn test_ret_impl_trait_err(n: i32) -> Result, &'static str> { Ok((0..10).filter(move |x| *x < n)) @@ -30,6 +32,15 @@ async fn test_ret_impl_trait_err(n: i32) -> Result, &' #[instrument] async fn test_async_fn_empty() {} +// Reproduces a compile error when an instrumented function body contains inner +// attributes (https://github.com/tokio-rs/tracing/issues/2294). +#[deny(unused_variables)] +#[instrument] +async fn repro_async_2294() { + #![allow(unused_variables)] + let i = 42; +} + // Reproduces https://github.com/tokio-rs/tracing/issues/1613 #[instrument] // LOAD-BEARING `#[rustfmt::skip]`! This is necessary to reproduce the bug; @@ -53,6 +64,7 @@ async fn repro_1613_2() { } // Reproduces https://github.com/tokio-rs/tracing/issues/1831 +#[allow(dead_code)] // this is just here to test whether it compiles. #[instrument] #[deny(unused_braces)] fn repro_1831() -> Pin>> { @@ -61,6 +73,7 @@ fn repro_1831() -> Pin>> { // This replicates the pattern used to implement async trait methods on nightly using the // `type_alias_impl_trait` feature +#[allow(dead_code)] // this is just here to test whether it compiles. #[instrument(ret, err)] #[deny(unused_braces)] #[allow(clippy::manual_async_fn)] -- cgit v1.2.3