summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Barsky <dbarsky@meta.com>2023-11-16 07:31:54 -0800
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2023-11-16 07:31:54 -0800
commitf08e94636a07fca0d00aba72b1a09f442839aa2f (patch)
treedcff2eb0f334c51fdfcfcfea989924d25c46b679
parent4bef99f6c298364ba00e955b878b3473bca92fc1 (diff)
clippy: prevent holding a span guard over an `.await`
Summary: X-link: https://github.com/facebookresearch/Private-ID/pull/119 We should probably lint against using an `.enter()` guard over `.await` points for the reasons outlined in https://docs.rs/tracing/latest/tracing/struct.Span.html#in-asynchronous-code. Reviewed By: zertosh Differential Revision: D50528695 fbshipit-source-id: 82fcc97a83b5d820c8673e6f56794dc47fd4d77f
-rw-r--r--clippy.toml4
1 files changed, 4 insertions, 0 deletions
diff --git a/clippy.toml b/clippy.toml
index f5522e67..3c34d529 100644
--- a/clippy.toml
+++ b/clippy.toml
@@ -1 +1,5 @@
too-many-lines-threshold = 200
+await-holding-invalid-types = [
+ { path = "tracing::span::Entered", reason = "`Entered` is not aware when a function is suspended: https://docs.rs/tracing/latest/tracing/struct.Span.html#in-asynchronous-code" },
+ { path = "tracing::span::EnteredSpan", reason = "`EnteredSpan` is not aware when a function is suspended: https://docs.rs/tracing/latest/tracing/struct.Span.html#in-asynchronous-code" },
+]