diff --git a/tests/ui/rc_mutex.rs b/tests/ui/rc_mutex.rs index 14a3cfd644bc..657a3ecf6a00 100644 --- a/tests/ui/rc_mutex.rs +++ b/tests/ui/rc_mutex.rs @@ -1,6 +1,5 @@ #![warn(clippy::rc_mutex)] -#![allow(clippy::boxed_local, clippy::needless_pass_by_value)] -#![allow(clippy::blacklisted_name, unused_variables, dead_code)] +#![allow(clippy::blacklisted_name)] use std::rc::Rc; use std::sync::Mutex; @@ -24,4 +23,12 @@ pub fn test2(foo: Rc>) {} pub fn test3(foo: Rc>>) {} -fn main() {} +fn main() { + test1(Rc::new(Mutex::new(1))); + test2(Rc::new(Mutex::new(MyEnum::One))); + test3(Rc::new(Mutex::new(SubT { foo: 1 }))); + + let _my_struct = MyStruct { + foo: Rc::new(Mutex::new(1)), + }; +} diff --git a/tests/ui/rc_mutex.stderr b/tests/ui/rc_mutex.stderr index c32780acf9f2..8e58e2bc2d0b 100644 --- a/tests/ui/rc_mutex.stderr +++ b/tests/ui/rc_mutex.stderr @@ -1,5 +1,5 @@ error: found `Rc>`. Consider using `Rc>` or `Arc>` instead - --> $DIR/rc_mutex.rs:9:10 + --> $DIR/rc_mutex.rs:8:10 | LL | foo: Rc>, | ^^^^^^^^^^^^^^ @@ -7,19 +7,19 @@ LL | foo: Rc>, = note: `-D clippy::rc-mutex` implied by `-D warnings` error: found `Rc>`. Consider using `Rc>` or `Arc>` instead - --> $DIR/rc_mutex.rs:21:22 + --> $DIR/rc_mutex.rs:20:22 | LL | pub fn test1(foo: Rc>) {} | ^^^^^^^^^^^^ error: found `Rc>`. Consider using `Rc>` or `Arc>` instead - --> $DIR/rc_mutex.rs:23:19 + --> $DIR/rc_mutex.rs:22:19 | LL | pub fn test2(foo: Rc>) {} | ^^^^^^^^^^^^^^^^^ error: found `Rc>`. Consider using `Rc>` or `Arc>` instead - --> $DIR/rc_mutex.rs:25:19 + --> $DIR/rc_mutex.rs:24:19 | LL | pub fn test3(foo: Rc>>) {} | ^^^^^^^^^^^^^^^^^^^^^^