summaryrefslogtreecommitdiffstats
path: root/vendor/tracing-attributes/tests/instrument.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vendor/tracing-attributes/tests/instrument.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/tracing-attributes/tests/instrument.rs b/vendor/tracing-attributes/tests/instrument.rs
index 2b2fee71e..768692748 100644
--- a/vendor/tracing-attributes/tests/instrument.rs
+++ b/vendor/tracing-attributes/tests/instrument.rs
@@ -3,6 +3,15 @@ use tracing::Level;
use tracing_attributes::instrument;
use tracing_mock::*;
+// Reproduces a compile error when an instrumented function body contains inner
+// attributes (https://github.com/tokio-rs/tracing/issues/2294).
+#[deny(unused_variables)]
+#[instrument]
+fn repro_2294() {
+ #![allow(unused_variables)]
+ let i = 42;
+}
+
#[test]
fn override_everything() {
#[instrument(target = "my_target", level = "debug")]