From 5e435b12208f58ed3f40761c1d223d941b622e15 Mon Sep 17 00:00:00 2001 From: Folyd Date: Sat, 1 May 2021 01:25:44 +0800 Subject: [PATCH] subscriber: deprecate `CurrentSpan` (#1321) The `tracing-subscriber::CurrentSpan` should be deprecated in `v0.2.x`. Related PR #1320. Co-authored-by: Eliza Weisman --- tracing-subscriber/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tracing-subscriber/src/lib.rs b/tracing-subscriber/src/lib.rs index 1d0f6580c3..6c73bd1410 100644 --- a/tracing-subscriber/src/lib.rs +++ b/tracing-subscriber/src/lib.rs @@ -160,10 +160,12 @@ pub use fmt::fmt; use std::default::Default; /// Tracks the currently executing span on a per-thread basis. #[derive(Debug)] +#[deprecated(since = "0.2.18", note = "Will be removed in v0.3")] pub struct CurrentSpan { current: thread::Local>, } +#[allow(deprecated)] impl CurrentSpan { /// Returns a new `CurrentSpan`. pub fn new() -> Self { @@ -194,6 +196,7 @@ impl CurrentSpan { } } +#[allow(deprecated)] impl Default for CurrentSpan { fn default() -> Self { Self::new()