about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/arc_with_non_send_sync.rs6
-rw-r--r--tests/ui/arc_with_non_send_sync.stderr32
2 files changed, 22 insertions, 16 deletions
diff --git a/tests/ui/arc_with_non_send_sync.rs b/tests/ui/arc_with_non_send_sync.rs
index d03a577c454..349e81912e3 100644
--- a/tests/ui/arc_with_non_send_sync.rs
+++ b/tests/ui/arc_with_non_send_sync.rs
@@ -33,16 +33,16 @@ fn main() {
     let _ = Arc::new(42);
 
     let _ = Arc::new(RefCell::new(42));
-    //~^ ERROR: usage of an `Arc` that is not `Send` or `Sync`
+    //~^ ERROR: usage of an `Arc` that is not `Send` and `Sync`
     //~| NOTE: the trait `Sync` is not implemented for `RefCell<i32>`
 
     let mutex = Mutex::new(1);
     let _ = Arc::new(mutex.lock().unwrap());
-    //~^ ERROR: usage of an `Arc` that is not `Send` or `Sync`
+    //~^ ERROR: usage of an `Arc` that is not `Send` and `Sync`
     //~| NOTE: the trait `Send` is not implemented for `MutexGuard<'_, i32>`
 
     let _ = Arc::new(&42 as *const i32);
-    //~^ ERROR: usage of an `Arc` that is not `Send` or `Sync`
+    //~^ ERROR: usage of an `Arc` that is not `Send` and `Sync`
     //~| NOTE: the trait `Send` is not implemented for `*const i32`
     //~| NOTE: the trait `Sync` is not implemented for `*const i32`
 }
diff --git a/tests/ui/arc_with_non_send_sync.stderr b/tests/ui/arc_with_non_send_sync.stderr
index fd239580d28..a7f91abda4e 100644
--- a/tests/ui/arc_with_non_send_sync.stderr
+++ b/tests/ui/arc_with_non_send_sync.stderr
@@ -1,35 +1,41 @@
-error: usage of an `Arc` that is not `Send` or `Sync`
+error: usage of an `Arc` that is not `Send` and `Sync`
   --> $DIR/arc_with_non_send_sync.rs:35:13
    |
 LL |     let _ = Arc::new(RefCell::new(42));
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: the trait `Sync` is not implemented for `RefCell<i32>`
-   = note: required for `Arc<RefCell<i32>>` to implement `Send` and `Sync`
-   = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
+   = note: `Arc<RefCell<i32>>` is not `Send` and `Sync` as:
+   = note: - the trait `Sync` is not implemented for `RefCell<i32>`
+   = help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
+   = note: if you intend to use `Arc` with `Send` and `Sync` traits
+   = note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `RefCell<i32>`
    = note: `-D clippy::arc-with-non-send-sync` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::arc_with_non_send_sync)]`
 
-error: usage of an `Arc` that is not `Send` or `Sync`
+error: usage of an `Arc` that is not `Send` and `Sync`
   --> $DIR/arc_with_non_send_sync.rs:40:13
    |
 LL |     let _ = Arc::new(mutex.lock().unwrap());
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: the trait `Send` is not implemented for `MutexGuard<'_, i32>`
-   = note: required for `Arc<MutexGuard<'_, i32>>` to implement `Send` and `Sync`
-   = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
+   = note: `Arc<MutexGuard<'_, i32>>` is not `Send` and `Sync` as:
+   = note: - the trait `Send` is not implemented for `MutexGuard<'_, i32>`
+   = help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
+   = note: if you intend to use `Arc` with `Send` and `Sync` traits
+   = note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `MutexGuard<'_, i32>`
 
-error: usage of an `Arc` that is not `Send` or `Sync`
+error: usage of an `Arc` that is not `Send` and `Sync`
   --> $DIR/arc_with_non_send_sync.rs:44:13
    |
 LL |     let _ = Arc::new(&42 as *const i32);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: the trait `Send` is not implemented for `*const i32`
-   = note: the trait `Sync` is not implemented for `*const i32`
-   = note: required for `Arc<*const i32>` to implement `Send` and `Sync`
-   = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
+   = note: `Arc<*const i32>` is not `Send` and `Sync` as:
+   = note: - the trait `Send` is not implemented for `*const i32`
+   = note: - the trait `Sync` is not implemented for `*const i32`
+   = help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
+   = note: if you intend to use `Arc` with `Send` and `Sync` traits
+   = note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `*const i32`
 
 error: aborting due to 3 previous errors