about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/async_fn_in_trait.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-10-03 00:51:13 +0000
committerMichael Goulet <michael@errs.io>2023-10-03 00:51:13 +0000
commitc373d206cd9ed7beec89c72e61d76ad61d6d35c1 (patch)
tree2919a34639943818c0ee2af2a738e5d840291622 /compiler/rustc_lint/src/async_fn_in_trait.rs
parent90dfa24415d4f29e1970bf215458ccefec60f85f (diff)
downloadrust-c373d206cd9ed7beec89c72e61d76ad61d6d35c1.tar.gz
rust-c373d206cd9ed7beec89c72e61d76ad61d6d35c1.zip
Address review nits
Diffstat (limited to 'compiler/rustc_lint/src/async_fn_in_trait.rs')
-rw-r--r--compiler/rustc_lint/src/async_fn_in_trait.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_lint/src/async_fn_in_trait.rs b/compiler/rustc_lint/src/async_fn_in_trait.rs
index 9214e04bb8b..e0572b8ed43 100644
--- a/compiler/rustc_lint/src/async_fn_in_trait.rs
+++ b/compiler/rustc_lint/src/async_fn_in_trait.rs
@@ -39,8 +39,8 @@ declare_lint! {
     /// }
     ///
     /// fn test<T: Trait>(x: T) {
-    ///     fn is_send<T: Send>(_: T) {}
-    ///     is_send(x.method()); // Not OK.
+    ///     fn spawn<T: Send>(_: T) {}
+    ///     spawn(x.method()); // Not OK.
     /// }
     /// ```
     ///
@@ -68,11 +68,10 @@ declare_lint! {
     /// }
     /// ```
     ///
-    /// Conversely, if the trait is used only locally, if only concrete types
-    /// that implement the trait are used, or if the trait author otherwise
-    /// does not care that the trait will not promise that the returned
-    /// [`Future`] implements any [auto traits] such as [`Send`], then the
-    /// lint may be suppressed.
+    /// Conversely, if the trait is used only locally, if it is never used in
+    /// generic functions, or if it is only used in single-threaded contexts
+    /// that do not care whether the returned [`Future`] implements [auto traits]
+    /// such as [`Send`], then the lint may be suppressed.
     ///
     /// [`Future`]: https://doc.rust-lang.org/core/future/trait.Future.html
     /// [`Send`]: https://doc.rust-lang.org/core/marker/trait.Send.html