diff --git a/tracing/src/span.rs b/tracing/src/span.rs index 6ca7f886aa..f379c76e32 100644 --- a/tracing/src/span.rs +++ b/tracing/src/span.rs @@ -605,9 +605,13 @@ impl Span { /// async fn my_async_function() { /// let span = info_span!("my_async_function"); /// - /// // THIS WILL RESULT IN INCORRECT TRACES + /// // WARNING: This span will remain entered until this + /// // guard is dropped... /// let _enter = span.enter(); - /// some_other_async_function().await; + /// // ...but the `await` keyword may yield, causing the + /// // runtime to switch to another task, while remaining in + /// // this span! + /// some_other_async_function().await /// /// // ... /// }