From c0fd250c62abccc0b453677969fa69ddeb6f06d4 Mon Sep 17 00:00:00 2001 From: Yechan Bae Date: Tue, 7 Dec 2021 10:02:58 -0500 Subject: [PATCH] Fix grammar issues --- .../src/non_send_fields_in_send_ty.rs | 4 ++-- .../test.stderr | 8 +++---- tests/ui/non_send_fields_in_send_ty.stderr | 24 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/clippy_lints/src/non_send_fields_in_send_ty.rs b/clippy_lints/src/non_send_fields_in_send_ty.rs index 88cbf3eae0d0..97f492e518a4 100644 --- a/clippy_lints/src/non_send_fields_in_send_ty.rs +++ b/clippy_lints/src/non_send_fields_in_send_ty.rs @@ -17,7 +17,7 @@ declare_clippy_lint! { /// contains fields that are not safe to be sent across threads. /// It tries to detect fields that can cause a soundness issue /// when sent to another thread (e.g., `Rc`) while allowing `!Send` fields - /// that are expected to exist in a `Send` type such as raw pointers. + /// that are expected to exist in a `Send` type, such as raw pointers. /// /// ### Why is this bad? /// Sending the struct to another thread effectively sends all of its fields, @@ -124,7 +124,7 @@ impl<'tcx> LateLintPass<'tcx> for NonSendFieldInSendTy { NON_SEND_FIELDS_IN_SEND_TY, item.span, &format!( - "there are some fields in `{}` are not safe to be sent to another thread", + "some fields in `{}` are not safe to be sent to another thread", snippet(cx, hir_impl.self_ty.span, "Unknown") ), |diag| { diff --git a/tests/ui-toml/strict_non_send_fields_in_send_ty/test.stderr b/tests/ui-toml/strict_non_send_fields_in_send_ty/test.stderr index c3c4b67b463b..49eecf18b4c4 100644 --- a/tests/ui-toml/strict_non_send_fields_in_send_ty/test.stderr +++ b/tests/ui-toml/strict_non_send_fields_in_send_ty/test.stderr @@ -1,4 +1,4 @@ -error: there are some fields in `NoGeneric` are not safe to be sent to another thread +error: some fields in `NoGeneric` are not safe to be sent to another thread --> $DIR/test.rs:11:1 | LL | unsafe impl Send for NoGeneric {} @@ -12,7 +12,7 @@ LL | rc_is_not_send: Rc, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: use a thread-safe type that implements `Send` -error: there are some fields in `MultiField` are not safe to be sent to another thread +error: some fields in `MultiField` are not safe to be sent to another thread --> $DIR/test.rs:19:1 | LL | unsafe impl Send for MultiField {} @@ -37,7 +37,7 @@ LL | field3: T, | ^^^^^^^^^ = help: add `T: Send` bound in `Send` impl -error: there are some fields in `MyOption` are not safe to be sent to another thread +error: some fields in `MyOption` are not safe to be sent to another thread --> $DIR/test.rs:26:1 | LL | unsafe impl Send for MyOption {} @@ -50,7 +50,7 @@ LL | MySome(T), | ^ = help: add `T: Send` bound in `Send` impl -error: there are some fields in `HeuristicTest` are not safe to be sent to another thread +error: some fields in `HeuristicTest` are not safe to be sent to another thread --> $DIR/test.rs:41:1 | LL | unsafe impl Send for HeuristicTest {} diff --git a/tests/ui/non_send_fields_in_send_ty.stderr b/tests/ui/non_send_fields_in_send_ty.stderr index aeaaef794f95..60df4e226e4f 100644 --- a/tests/ui/non_send_fields_in_send_ty.stderr +++ b/tests/ui/non_send_fields_in_send_ty.stderr @@ -1,4 +1,4 @@ -error: there are some fields in `RingBuffer` are not safe to be sent to another thread +error: some fields in `RingBuffer` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:16:1 | LL | unsafe impl Send for RingBuffer {} @@ -12,7 +12,7 @@ LL | data: Vec>, | ^^^^^^^^^^^^^^^^^^^^^^^^ = help: add bounds on type parameter `T` that satisfy `Vec>: Send` -error: there are some fields in `MvccRwLock` are not safe to be sent to another thread +error: some fields in `MvccRwLock` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:24:1 | LL | unsafe impl Send for MvccRwLock {} @@ -25,7 +25,7 @@ LL | lock: Mutex>, | ^^^^^^^^^^^^^^^^^^^ = help: add bounds on type parameter `T` that satisfy `Mutex>: Send` -error: there are some fields in `ArcGuard` are not safe to be sent to another thread +error: some fields in `ArcGuard` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:32:1 | LL | unsafe impl Send for ArcGuard {} @@ -38,7 +38,7 @@ LL | head: Arc, | ^^^^^^^^^^^^^ = help: add bounds on type parameter `RC` that satisfy `Arc: Send` -error: there are some fields in `DeviceHandle` are not safe to be sent to another thread +error: some fields in `DeviceHandle` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:48:1 | LL | unsafe impl Send for DeviceHandle {} @@ -51,7 +51,7 @@ LL | context: T, | ^^^^^^^^^^ = help: add `T: Send` bound in `Send` impl -error: there are some fields in `NoGeneric` are not safe to be sent to another thread +error: some fields in `NoGeneric` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:55:1 | LL | unsafe impl Send for NoGeneric {} @@ -64,7 +64,7 @@ LL | rc_is_not_send: Rc, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: use a thread-safe type that implements `Send` -error: there are some fields in `MultiField` are not safe to be sent to another thread +error: some fields in `MultiField` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:63:1 | LL | unsafe impl Send for MultiField {} @@ -89,7 +89,7 @@ LL | field3: T, | ^^^^^^^^^ = help: add `T: Send` bound in `Send` impl -error: there are some fields in `MyOption` are not safe to be sent to another thread +error: some fields in `MyOption` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:70:1 | LL | unsafe impl Send for MyOption {} @@ -102,7 +102,7 @@ LL | MySome(T), | ^ = help: add `T: Send` bound in `Send` impl -error: there are some fields in `MultiParam` are not safe to be sent to another thread +error: some fields in `MultiParam` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:82:1 | LL | unsafe impl Send for MultiParam {} @@ -115,7 +115,7 @@ LL | vec: Vec<(A, B)>, | ^^^^^^^^^^^^^^^^ = help: add bounds on type parameters `A, B` that satisfy `Vec<(A, B)>: Send` -error: there are some fields in `HeuristicTest` are not safe to be sent to another thread +error: some fields in `HeuristicTest` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:100:1 | LL | unsafe impl Send for HeuristicTest {} @@ -128,7 +128,7 @@ LL | field4: (*const NonSend, Rc), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: use a thread-safe type that implements `Send` -error: there are some fields in `AttrTest3` are not safe to be sent to another thread +error: some fields in `AttrTest3` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:119:1 | LL | unsafe impl Send for AttrTest3 {} @@ -141,7 +141,7 @@ LL | Enum2(T), | ^ = help: add `T: Send` bound in `Send` impl -error: there are some fields in `Complex` are not safe to be sent to another thread +error: some fields in `Complex` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:127:1 | LL | unsafe impl

Send for Complex {} @@ -154,7 +154,7 @@ LL | field1: A, | ^^^^^^^^^ = help: add `P: Send` bound in `Send` impl -error: there are some fields in `Complex>` are not safe to be sent to another thread +error: some fields in `Complex>` are not safe to be sent to another thread --> $DIR/non_send_fields_in_send_ty.rs:130:1 | LL | unsafe impl Send for Complex> {}