rust-clippy/tests/ui/arc_with_non_send_sync.rs
2023-06-07 20:53:48 -07:00

12 lines
329 B
Rust

#![warn(clippy::arc_with_non_send_sync)]
#![allow(unused_variables)]
use std::cell::RefCell;
use std::sync::{Arc, Mutex};
fn main() {
// This is safe, as `i32` implements `Send` and `Sync`.
let a = Arc::new(42);
// This is not safe, as `RefCell` does not implement `Sync`.
let b = Arc::new(RefCell::new(42));
}