File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 11#![ warn( clippy:: rc_mutex) ]
2- #![ allow( clippy:: boxed_local, clippy:: needless_pass_by_value) ]
3- #![ allow( clippy:: blacklisted_name, unused_variables, dead_code) ]
2+ #![ allow( clippy:: blacklisted_name) ]
43
54use std:: rc:: Rc ;
65use std:: sync:: Mutex ;
@@ -24,4 +23,12 @@ pub fn test2(foo: Rc<Mutex<MyEnum>>) {}
2423
2524pub fn test3 ( foo : Rc < Mutex < SubT < usize > > > ) { }
2625
27- fn main ( ) { }
26+ fn main ( ) {
27+ test1 ( Rc :: new ( Mutex :: new ( 1 ) ) ) ;
28+ test2 ( Rc :: new ( Mutex :: new ( MyEnum :: One ) ) ) ;
29+ test3 ( Rc :: new ( Mutex :: new ( SubT { foo : 1 } ) ) ) ;
30+
31+ let _my_struct = MyStruct {
32+ foo : Rc :: new ( Mutex :: new ( 1 ) ) ,
33+ } ;
34+ }
Original file line number Diff line number Diff line change 11error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` or `Arc<Mutex<_>>` instead
2- --> $DIR/rc_mutex.rs:9 :10
2+ --> $DIR/rc_mutex.rs:8 :10
33 |
44LL | foo: Rc<Mutex<i32>>,
55 | ^^^^^^^^^^^^^^
66 |
77 = note: `-D clippy::rc-mutex` implied by `-D warnings`
88
99error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` or `Arc<Mutex<_>>` instead
10- --> $DIR/rc_mutex.rs:21 :22
10+ --> $DIR/rc_mutex.rs:20 :22
1111 |
1212LL | pub fn test1<T>(foo: Rc<Mutex<T>>) {}
1313 | ^^^^^^^^^^^^
1414
1515error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` or `Arc<Mutex<_>>` instead
16- --> $DIR/rc_mutex.rs:23 :19
16+ --> $DIR/rc_mutex.rs:22 :19
1717 |
1818LL | pub fn test2(foo: Rc<Mutex<MyEnum>>) {}
1919 | ^^^^^^^^^^^^^^^^^
2020
2121error: found `Rc<Mutex<_>>`. Consider using `Rc<RefCell<_>>` or `Arc<Mutex<_>>` instead
22- --> $DIR/rc_mutex.rs:25 :19
22+ --> $DIR/rc_mutex.rs:24 :19
2323 |
2424LL | pub fn test3(foo: Rc<Mutex<SubT<usize>>>) {}
2525 | ^^^^^^^^^^^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments