Skip to content

Commit 5a27105

Browse files
committed
fail tests if inner attrs are eaten
1 parent a113fde commit 5a27105

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tracing-attributes/tests/async_fn.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ async fn test_ret_impl_trait_err(n: i32) -> Result<impl Iterator<Item = i32>, &'
3232
#[instrument]
3333
async fn test_async_fn_empty() {}
3434

35+
// Reproduces a compile error when an instrumented function body contains inner
36+
// attributes (https://github.com/tokio-rs/tracing/issues/2294).
37+
#[deny(unused_variables)]
3538
#[instrument]
3639
async fn repro_async_2294() {
3740
#![allow(unused_variables)]

tracing-attributes/tests/instrument.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ use tracing::Level;
33
use tracing_attributes::instrument;
44
use tracing_mock::*;
55

6+
// Reproduces a compile error when an instrumented function body contains inner
7+
// attributes (https://github.com/tokio-rs/tracing/issues/2294).
8+
#[deny(unused_variables)]
69
#[instrument]
710
fn repro_2294() {
811
#![allow(unused_variables)]

0 commit comments

Comments
 (0)