Skip to content

Commit

Permalink
clippy: prevent holding a span guard over an .await (#119)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
davidbarsky authored and facebook-github-bot committed Nov 16, 2023
1 parent 26b08dd commit f1cda2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/rust/ossconfigs/clippy.toml
Original file line number Diff line number Diff line change
@@ -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" },
]

0 comments on commit f1cda2b

Please sign in to comment.