Skip to content

Commit 5cd24d7

Browse files
committed
Correct help message for arc_with_non_send_sync
1 parent 8ad5c67 commit 5cd24d7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clippy_lints/src/arc_with_non_send_sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl<'tcx> LateLintPass<'tcx> for ArcWithNonSendSync {
7373
diag.note(format!(
7474
"`Arc<{arg_ty}>` is not `Send` and `Sync` as `{arg_ty}` is {reason}"
7575
));
76-
diag.help("if the `Arc` will not used be across threads replace it with an `Rc`");
76+
diag.help("if the `Arc` will not be used across threads replace it with an `Rc`");
7777
diag.help(format!(
7878
"otherwise make `{arg_ty}` `Send` and `Sync` or consider a wrapper type such as `Mutex`"
7979
));

tests/ui/arc_with_non_send_sync.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let _ = Arc::new(RefCell::new(42));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `Arc<RefCell<i32>>` is not `Send` and `Sync` as `RefCell<i32>` is not `Sync`
8-
= help: if the `Arc` will not used be across threads replace it with an `Rc`
8+
= help: if the `Arc` will not be used across threads replace it with an `Rc`
99
= help: otherwise make `RefCell<i32>` `Send` and `Sync` or consider a wrapper type such as `Mutex`
1010
= note: `-D clippy::arc-with-non-send-sync` implied by `-D warnings`
1111
= help: to override `-D warnings` add `#[allow(clippy::arc_with_non_send_sync)]`
@@ -17,7 +17,7 @@ LL | let _ = Arc::new(mutex.lock().unwrap());
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818
|
1919
= note: `Arc<MutexGuard<'_, i32>>` is not `Send` and `Sync` as `MutexGuard<'_, i32>` is not `Send`
20-
= help: if the `Arc` will not used be across threads replace it with an `Rc`
20+
= help: if the `Arc` will not be used across threads replace it with an `Rc`
2121
= help: otherwise make `MutexGuard<'_, i32>` `Send` and `Sync` or consider a wrapper type such as `Mutex`
2222

2323
error: usage of an `Arc` that is not `Send` and `Sync`
@@ -27,7 +27,7 @@ LL | let _ = Arc::new(&42 as *const i32);
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2828
|
2929
= note: `Arc<*const i32>` is not `Send` and `Sync` as `*const i32` is neither `Send` nor `Sync`
30-
= help: if the `Arc` will not used be across threads replace it with an `Rc`
30+
= help: if the `Arc` will not be used across threads replace it with an `Rc`
3131
= help: otherwise make `*const i32` `Send` and `Sync` or consider a wrapper type such as `Mutex`
3232

3333
error: aborting due to 3 previous errors

0 commit comments

Comments
 (0)