Skip to content

Commit 5344192

Browse files
fixup! Add await_holding_invalid_type lint
1 parent 3cd8b5a commit 5344192

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clippy_lints/src/await_holding_invalid.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,21 @@ declare_clippy_lint! {
144144
///
145145
/// ### Example
146146
///
147-
/// The `tracing` library has types which should not be held across `await`
148-
/// points.
147+
/// Strings are, of course, safe to hold across await points. This example
148+
/// exists only to show how this lint might be configured for third-party
149+
/// crates.
149150
///
150151
/// ```toml
151152
/// await-holding-invalid-types = [
152-
/// "tracing::span::Entered",
153-
/// "tracing::span::EnteredSpan",
153+
/// "std::string::String",
154154
/// ]
155155
/// ```
156156
///
157157
/// ```rust
158158
/// # async fn baz() {}
159159
/// async fn foo() {
160-
/// let _entered = tracing::info_span!("baz").entered();
161-
/// baz().await;
160+
/// let _x = String::from("hello!");
161+
/// baz().await; // Lint violation
162162
/// }
163163
/// ```
164164
#[clippy::version = "1.49.0"]

0 commit comments

Comments
 (0)